Index: runtime/vm/thread.h |
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h |
index 69cc4ecd17b2f70a429bd02bd899675a274b5496..8a57c2b18c49b5ebcd49f2e93b650989236e1fbf 100644 |
--- a/runtime/vm/thread.h |
+++ b/runtime/vm/thread.h |
@@ -38,6 +38,9 @@ class Zone; |
CACHED_VM_OBJECTS_LIST(V) \ |
CACHED_ADDRESSES_LIST(V) |
+// TODO(koda): Merge thread.h and thread_registry.h. |
+typedef int64_t SafepointId; |
+static const SafepointId kNoSafepointId = -1; |
// A VM thread; may be executing Dart code or performing helper tasks like |
// garbage collection or compilation. The Thread structure associated with |
@@ -63,7 +66,13 @@ class Thread { |
// "helper" to gain limited concurrent access to the isolate. One example is |
// SweeperTask (which uses the class table, which is copy-on-write). |
// TODO(koda): Properly synchronize heap access to expand allowed operations. |
- static void EnterIsolateAsHelper(Isolate* isolate); |
+ // |
+ // If 'pass_safepoint' is set to the current rendezvous (returned by |
+ // ThreadRegistry::SafepointThreads), the thread will be allowed free passage |
+ // into the isolate while this rendezvous is in progress. |
+ static void EnterIsolateAsHelper( |
+ Isolate* isolate, |
+ SafepointId pass_safepoint = kNoSafepointId); |
static void ExitIsolateAsHelper(); |
// Called when the current thread transitions from mutator to collector. |
@@ -233,6 +242,7 @@ CACHED_CONSTANTS_LIST(DEFINE_OFFSET_METHOD) |
Heap* heap_; |
State state_; |
StoreBufferBlock* store_buffer_block_; |
+ SafepointId pass_safepoint_; |
#define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value) \ |
type_name member_name; |
CACHED_CONSTANTS_LIST(DECLARE_MEMBERS) |