| Index: runtime/vm/os_thread.cc
|
| diff --git a/runtime/vm/os_thread.cc b/runtime/vm/os_thread.cc
|
| index 766bbbed97d9f46800e24be459df8d8e0f2b6fe0..f6a7498280a6a2545b49266a08391066d99aced8 100644
|
| --- a/runtime/vm/os_thread.cc
|
| +++ b/runtime/vm/os_thread.cc
|
| @@ -36,14 +36,18 @@ OSThread::OSThread() :
|
|
|
|
|
| OSThread* OSThread::CreateOSThread() {
|
| - ASSERT(thread_list_lock_ != NULL);
|
| - MutexLocker ml(thread_list_lock_);
|
| - if (!creation_enabled_) {
|
| + if (thread_list_lock_ == NULL) {
|
| return NULL;
|
| }
|
| - OSThread* os_thread = new OSThread();
|
| - AddThreadToListLocked(os_thread);
|
| - return os_thread;
|
| + {
|
| + MutexLocker ml(thread_list_lock_);
|
| + if (!creation_enabled_) {
|
| + return NULL;
|
| + }
|
| + OSThread* os_thread = new OSThread();
|
| + AddThreadToListLocked(os_thread);
|
| + return os_thread;
|
| + }
|
| }
|
|
|
|
|
|
|