Chromium Code Reviews| Index: runtime/vm/isolate.h |
| diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h |
| index 5dd7085192de2ea183d243b8dac9b48e70a455df..c75a852dc2a2f8574a0fc05f48fe75e96a52aea5 100644 |
| --- a/runtime/vm/isolate.h |
| +++ b/runtime/vm/isolate.h |
| @@ -758,8 +758,15 @@ class Isolate : public BaseIsolate { |
| bool is_service_isolate() const { return is_service_isolate_; } |
| + static void KillAllIsolates(); |
| + static void KillIfExists(Isolate* isolate); |
| + |
| + static void DisableIsolateCreation(); |
| + static void EnableIsolateCreation(); |
| + |
| private: |
| friend class Dart; // Init, InitOnce, Shutdown. |
| + friend class IsolateKillerVisitor; // Kill(). |
| explicit Isolate(const Dart_IsolateFlags& api_flags); |
| @@ -767,6 +774,11 @@ class Isolate : public BaseIsolate { |
| static Isolate* Init(const char* name_prefix, |
| const Dart_IsolateFlags& api_flags, |
| bool is_vm_isolate = false); |
| + |
| + // The isolates_list_monitor_ should be held when calling Kill(). |
| + void Kill(); |
|
Ivan Posva
2015/09/15 16:18:42
KillLocked to indicate that the lock should be hel
|
| + |
| + void LowLevelShutdown(); |
| void Shutdown(); |
| // Assumes mutator is the only thread still in the isolate. |
| void CloseAllTimelineBlocks(); |
| @@ -961,11 +973,13 @@ class Isolate : public BaseIsolate { |
| static void WakePauseEventHandler(Dart_Isolate isolate); |
| // Manage list of existing isolates. |
| - static void AddIsolateTolist(Isolate* isolate); |
| + static bool AddIsolateToList(Isolate* isolate); |
| static void RemoveIsolateFromList(Isolate* isolate); |
| - static Monitor* isolates_list_monitor_; // Protects isolates_list_head_ |
| + // This monitor protects isolates_list_head_, and creation_enabled_. |
| + static Monitor* isolates_list_monitor_; |
| static Isolate* isolates_list_head_; |
| + static bool creation_enabled_; |
| #define REUSABLE_FRIEND_DECLARATION(name) \ |
| friend class Reusable##name##HandleScope; |