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

Unified Diff: runtime/vm/isolate.cc

Issue 474913004: - Account for number of pending tasks in old-space collections. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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/isolate.cc
===================================================================
--- runtime/vm/isolate.cc (revision 39381)
+++ runtime/vm/isolate.cc (working copy)
@@ -600,6 +600,8 @@
void Isolate::SetStackLimit(uword limit) {
+ // The isolate setting the stack limit is not necessarily the isolate which
+ // the stack limit is being set on.
MutexLocker ml(mutex_);
if (stack_limit_ == saved_stack_limit_) {
// No interrupt pending, set stack_limit_ too.
@@ -625,16 +627,12 @@
void Isolate::ScheduleInterrupts(uword interrupt_bits) {
- // TODO(turnidge): Can't use MutexLocker here because MutexLocker is
- // a StackResource, which requires a current isolate. Should
- // MutexLocker really be a StackResource?
- mutex_->Lock();
+ MutexLocker ml(mutex_);
ASSERT((interrupt_bits & ~kInterruptsMask) == 0); // Must fit in mask.
if (stack_limit_ == saved_stack_limit_) {
stack_limit_ = (~static_cast<uword>(0)) & ~kInterruptsMask;
}
stack_limit_ |= interrupt_bits;
- mutex_->Unlock();
}
@@ -656,12 +654,9 @@
bool Isolate::MakeRunnable() {
ASSERT(Isolate::Current() == NULL);
- // Can't use MutexLocker here because MutexLocker is
- // a StackResource, which requires a current isolate.
- mutex_->Lock();
+ MutexLocker ml(mutex_);
// Check if we are in a valid state to make the isolate runnable.
if (is_runnable_ == true) {
- mutex_->Unlock();
return false; // Already runnable.
}
// Set the isolate as runnable and if we are being spawned schedule
@@ -676,7 +671,6 @@
ASSERT(this == state->isolate());
Run();
}
- mutex_->Unlock();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698