Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 10th, 2010  |  syntax: None  |  size: 0.53 KB  |  views: 76  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. bool Thread::StartWithOptions(const Options& options) {
  2.   DCHECK(!message_loop_);
  3.  
  4.   SetThreadWasQuitProperly(false);
  5.  
  6.   StartupData startup_data(options);
  7.   startup_data_ = &startup_data;
  8.  
  9.   if (!PlatformThread::Create(options.stack_size, this, &thread_)) {
  10.     DLOG(ERROR) << "failed to create thread";
  11.     startup_data_ = NULL;  // Record that we failed to start.
  12.     return false;
  13.   }
  14.  
  15.   // Wait for the thread to start and initialize message_loop_
  16.   startup_data.event.Wait();
  17.  
  18.   DCHECK(message_loop_);
  19.   return true;
  20. }
clone this paste RAW Paste Data