zircon/kernel/object/thread_dispatcher.cc
zx_status_t ThreadDispatcher::Initialize() {
  LTRACE_ENTRY_OBJ;
  // Associate the proc's address space with this thread.
  process_->aspace()->AttachToThread(core_thread_);

  // Make sure we contribute a FutexState object to our process's futex state.
  auto result = process_->futex_context().GrowFutexStatePool();
  if (result != ZX_OK) {
    return result;
  }

  Guard<fbl::Mutex> guard{get_lock()};
  // we've entered the initialized state
  SetStateLocked(ThreadState::Lifecycle::INITIALIZED);
  return ZX_OK;
}
// complete initialization of the thread object outside of the constructor
complete initialization of the thread object outside of the constructor
complete initialization of the thread object outside of the constructor
zx_status_t ThreadDispatcher::Initialize() {
  LTRACE_ENTRY_OBJ;
  process_->aspace()->AttachToThread(core_thread_);
  auto result = process_->futex_context().GrowFutexStatePool();
  if (result != ZX_OK) {
    return result;
  }
  Guard<fbl::Mutex> guard{get_lock()};
  SetStateLocked(ThreadState::Lifecycle::INITIALIZED);
  return ZX_OK;
}
zx_status_t ThreadDispatcher :: Initialize ( ) { LTRACE_ENTRY_OBJ ; process_ -> aspace ( ) -> AttachToThread ( core_thread_ ) ; auto result = process_ -> futex_context ( ) . GrowFutexStatePool ( ) ; if ( result != ZX_OK ) { return result ; } Guard < fbl :: Mutex > guard { get_lock ( ) } ; SetStateLocked ( ThreadState :: Lifecycle :: INITIALIZED ) ; return ZX_OK ; }
complete initialization of the thread object outside of the constructor
complete initialization of the thread object outside of the constructor
// Associate the proc's address space with this thread. // Make sure we contribute a FutexState object to our process's futex state. // we've entered the initialized state