Index: base/threading/simple_thread.cc |
=================================================================== |
--- base/threading/simple_thread.cc (revision 133458) |
+++ base/threading/simple_thread.cc (working copy) |
@@ -6,6 +6,7 @@ |
#include "base/logging.h" |
#include "base/threading/platform_thread.h" |
+#include "base/threading/thread_restrictions.h" |
#include "base/string_number_conversions.h" |
namespace base { |
@@ -30,6 +31,7 @@ |
DCHECK(!HasBeenStarted()) << "Tried to Start a thread multiple times."; |
bool success = PlatformThread::Create(options_.stack_size(), this, &thread_); |
DCHECK(success); |
+ base::ThreadRestrictions::ScopedAllowWait allow_wait; |
event_.Wait(); // Wait for the thread to complete initialization. |
} |
@@ -40,6 +42,11 @@ |
joined_ = true; |
} |
+bool SimpleThread::HasBeenStarted() { |
+ base::ThreadRestrictions::ScopedAllowWait allow_wait; |
+ return event_.IsSignaled(); |
+} |
+ |
void SimpleThread::ThreadMain() { |
tid_ = PlatformThread::CurrentId(); |
// Construct our full name of the form "name_prefix_/TID". |