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

Unified Diff: runtime/vm/isolate.cc

Issue 2344263002: Fix bad commit of stale patch set of original CL "Make NoReloadScope thread safe" (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « runtime/vm/isolate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 8d5ee80509795bad53c7f35de0dc52f6e6ed2008..a58c7baaf5373bda3593acfe5e392e14a42cb287 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -148,14 +148,15 @@ NoReloadScope::NoReloadScope(Isolate* isolate, Thread* thread)
isolate_(isolate) {
ASSERT(isolate_ != NULL);
AtomicOperations::FetchAndIncrement(&(isolate_->no_reload_scope_depth_));
+ ASSERT(
+ AtomicOperations::LoadRelaxed(&(isolate_->no_reload_scope_depth_)) >= 0);
}
NoReloadScope::~NoReloadScope() {
- uintptr_t previous_value =
- AtomicOperations::FetchAndDecrement(&(isolate_->no_reload_scope_depth_));
- // If the previous value was 0 we have underflowed.
- ASSERT(previous_value != 0);
+ AtomicOperations::FetchAndDecrement(&(isolate_->no_reload_scope_depth_));
+ ASSERT(
+ AtomicOperations::LoadRelaxed(&(isolate_->no_reload_scope_depth_)) >= 0);
}
« no previous file with comments | « runtime/vm/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698