예제 #1
0
 WorldState()
   : pending_threads_(0)
   , should_stop_(0)
   , time_waiting_(0)
 {
   mutex_.init();
   waiting_to_run_.init();
 }
예제 #2
0
 WorldState(bool* check_global_interrupts)
   : pending_threads_(0)
   , should_stop_(0)
   , check_global_interrupts_(check_global_interrupts)
   , time_waiting_(0)
 {
   mutex_.init();
   waiting_to_run_.init();
 }
예제 #3
0
 /**
  * Called after a fork(), when we know we're alone again, to get
  * everything back in the proper order.
  */
 void reinit() {
   // When we're reinitting the world state, we're stopped
   // so we have to initialize pending_threads_ to 0 and
   // should_stop to 1 so we start off in the proper state
   // and can continue after a fork.
   pending_threads_ = 0;
   should_stop_ = 1;
   mutex_.init();
   waiting_to_run_.init();
 }
예제 #4
0
파일: state.cpp 프로젝트: dziulius/rubinius
    void restart() {
      mutex_.init();
      condition_.init();
      pause_condition_.init();

      state = cUnknown;
      stop_ = false;
      pause_ = false;
      paused_ = false;

      run();
    }
예제 #5
0
 void unlock() {
   stop_ = false;
   wait_condition_.broadcast();
   lock_.unlock();
 }