
Untitled
By: a guest on
Jul 10th, 2010 | syntax:
None | size: 0.53 KB | views:
76 | expires: Never
bool Thread::StartWithOptions(const Options& options) {
DCHECK(!message_loop_);
SetThreadWasQuitProperly(false);
StartupData startup_data(options);
startup_data_ = &startup_data;
if (!PlatformThread::Create(options.stack_size, this, &thread_)) {
DLOG(ERROR) << "failed to create thread";
startup_data_ = NULL; // Record that we failed to start.
return false;
}
// Wait for the thread to start and initialize message_loop_
startup_data.event.Wait();
DCHECK(message_loop_);
return true;
}