FS-10465: [mod_v8] Fix javascript failures when a session callback is called from another thread/leg.

This commit is contained in:
Andrey Volk committed 2017-07-03 23:01:59 +03:00
1 parent f9d23ccadd
commit 105afc3f29
4 files changed
+44 -15

No files matched your search

@@ -130,6 +130,16 @@
if (v8::V8::IsExecutionTerminating(info.GetIsolate())) return;\
if (JSMain::GetScriptInstanceFromIsolate(info.GetIsolate()) && JSMain::GetScriptInstanceFromIsolate(info.GetIsolate())->GetForcedTermination()) return
/* Macro for easy unlocking an isolate on a long running c call */
#define JS_EXECUTE_LONG_RUNNING_C_CALL_WITH_UNLOCKER(call) {\
/* Unlock isolate on a long running c call to let another thread execute the callback */\
info.GetIsolate()->Exit();\
Unlocker unlock(info.GetIsolate());\
call;\
}\
/* Lock it back */\
info.GetIsolate()->Enter();
/* strdup function for all platforms */
#ifdef NDEBUG
#if (_MSC_VER >= 1500) // VC9+