Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 46f6d7128c102b3d978ff1c769339a13a3a063ed..82ace290cd5c2ee2a4249a9dd7201f61f7bcda10 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -842,10 +842,16 @@ void Isolate::CancelTerminateExecution() { |
void Isolate::InvokeApiInterruptCallback() { |
- InterruptCallback callback = api_interrupt_callback_; |
- void* data = api_interrupt_callback_data_; |
- api_interrupt_callback_ = NULL; |
- api_interrupt_callback_data_ = NULL; |
+ // Note: callback below should be called outside of execution access lock. |
+ InterruptCallback callback = NULL; |
+ void* data = NULL; |
+ { |
+ ExecutionAccess access(this); |
+ callback = api_interrupt_callback_; |
+ data = api_interrupt_callback_data_; |
+ api_interrupt_callback_ = NULL; |
+ api_interrupt_callback_data_ = NULL; |
+ } |
if (callback != NULL) { |
VMState<EXTERNAL> state(this); |