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

Unified Diff: runtime/vm/thread.h

Issue 1250463004: Migrate NoSafepointScope; add constrained concurrent allocation to unit test (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Assert current thread is mutator; add shared assertion macro. Created 5 years, 5 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/snapshot.cc ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.h
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index 98cd55d3f1bd6309ff0cea04058c177a637ccfd7..b1d273bd26ad2e447ab77f4b3877b62dbb685296 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -153,6 +153,28 @@ class Thread {
#endif
}
+ int32_t no_safepoint_scope_depth() const {
+#if defined(DEBUG)
+ return state_.no_safepoint_scope_depth;
+#else
+ return 0;
+#endif
+ }
+
+ void IncrementNoSafepointScopeDepth() {
+#if defined(DEBUG)
+ ASSERT(state_.no_safepoint_scope_depth < INT_MAX);
+ state_.no_safepoint_scope_depth += 1;
+#endif
+ }
+
+ void DecrementNoSafepointScopeDepth() {
+#if defined(DEBUG)
+ ASSERT(state_.no_safepoint_scope_depth > 0);
+ state_.no_safepoint_scope_depth -= 1;
+#endif
+ }
+
// Collection of isolate-specific state of a thread that is saved/restored
// on isolate exit/re-entry.
struct State {
@@ -162,6 +184,7 @@ class Thread {
#if defined(DEBUG)
HandleScope* top_handle_scope;
intptr_t no_handle_scope_depth;
+ int32_t no_safepoint_scope_depth;
#endif
};
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698