Revision: 19099
Author:   [email protected]
Date:     Wed Feb  5 11:28:55 2014 UTC
Log:      Use mutex in PostponeInterruptScope.

To avoid race with e.g. StackGuard::RequestInstallCode called from another
thread when both access postpone_interrupts_nesting_.

[email protected]
BUG=290964
LOG=N

Review URL: https://codereview.chromium.org/138833006
http://code.google.com/p/v8/source/detail?r=19099

Modified:
 /branches/bleeding_edge/src/isolate.h

=======================================
--- /branches/bleeding_edge/src/isolate.h       Thu Jan 30 13:18:41 2014 UTC
+++ /branches/bleeding_edge/src/isolate.h       Wed Feb  5 11:28:55 2014 UTC
@@ -1491,18 +1491,21 @@
 class PostponeInterruptsScope BASE_EMBEDDED {
  public:
   explicit PostponeInterruptsScope(Isolate* isolate)
-      : stack_guard_(isolate->stack_guard()) {
+      : stack_guard_(isolate->stack_guard()), isolate_(isolate) {
+    ExecutionAccess access(isolate_);
     stack_guard_->thread_local_.postpone_interrupts_nesting_++;
     stack_guard_->DisableInterrupts();
   }

   ~PostponeInterruptsScope() {
+    ExecutionAccess access(isolate_);
     if (--stack_guard_->thread_local_.postpone_interrupts_nesting_ == 0) {
       stack_guard_->EnableInterrupts();
     }
   }
  private:
   StackGuard* stack_guard_;
+  Isolate* isolate_;
 };


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to