Index: runtime/vm/os_thread.h |
diff --git a/runtime/vm/os_thread.h b/runtime/vm/os_thread.h |
index 9371b4538ae3d44227f23d13f58ac3bcd182551e..2dbbb510deda636621ef52c47cc6b278666e7841 100644 |
--- a/runtime/vm/os_thread.h |
+++ b/runtime/vm/os_thread.h |
@@ -50,7 +50,6 @@ class BaseThread { |
// Low-level operations on OS platform threads. |
class OSThread : public BaseThread { |
public: |
- OSThread(); |
~OSThread(); |
ThreadId id() const { |
@@ -170,17 +169,26 @@ class OSThread : public BaseThread { |
static bool Compare(ThreadId a, ThreadId b); |
static void GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage); |
+ static OSThread* CreateOSThread(); |
zra
2015/12/17 16:37:59
Maybe this should go up at the top of the class wh
siva
2015/12/17 18:19:13
Done.
|
+ |
// Called at VM startup and shutdown. |
static void InitOnce(); |
static bool IsThreadInList(ThreadJoinId join_id); |
+ static void DisableOSThreadCreation(); |
+ static void EnableOSThreadCreation(); |
+ |
static const intptr_t kStackSizeBuffer = (4 * KB * kWordSize); |
static const ThreadId kInvalidThreadId; |
static const ThreadJoinId kInvalidThreadJoinId; |
private: |
+ // The constructor is private as CreateOSThread should be used |
+ // to create a new OSThread structure. |
+ OSThread(); |
+ |
// These methods should not be used in a generic way and hence |
// are private, they have been added to solve the problem of |
// accessing the VM thread structure from an OSThread object |
@@ -220,6 +228,7 @@ class OSThread : public BaseThread { |
static OSThread* thread_list_head_; |
static Mutex* thread_list_lock_; |
+ static bool creation_enabled_; |
friend class OSThreadIterator; |
friend class ThreadInterrupterWin; |