Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(826)

Unified Diff: runtime/vm/thread.cc

Issue 1965823002: Initial isolate reload support (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 0ea6207ecfede6b4a24a83ceb363f37f43a2479f..69e782075ce2ea2e4b825190c2507d83adcf5758 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -85,6 +85,7 @@ Thread::Thread(Isolate* isolate)
#endif
reusable_handles_(),
saved_stack_limit_(0),
+ defer_oob_messages_count_(0),
deferred_interrupts_mask_(0),
deferred_interrupts_(0),
stack_overflow_count_(0),
@@ -423,6 +424,11 @@ uword Thread::GetAndClearInterrupts() {
void Thread::DeferOOBMessageInterrupts() {
MonitorLocker ml(thread_lock_);
+ defer_oob_messages_count_++;
+ if (defer_oob_messages_count_ > 1) {
+ // OOB message interrupts are already deferred.
+ return;
+ }
ASSERT(deferred_interrupts_mask_ == 0);
deferred_interrupts_mask_ = kMessageInterrupt;
@@ -447,6 +453,11 @@ void Thread::DeferOOBMessageInterrupts() {
void Thread::RestoreOOBMessageInterrupts() {
MonitorLocker ml(thread_lock_);
+ defer_oob_messages_count_--;
+ if (defer_oob_messages_count_ > 0) {
+ return;
+ }
+ ASSERT(defer_oob_messages_count_ == 0);
ASSERT(deferred_interrupts_mask_ == kMessageInterrupt);
deferred_interrupts_mask_ = 0;
if (deferred_interrupts_ != 0) {
« runtime/vm/object.cc ('K') | « runtime/vm/thread.h ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698