/** * Unlocks the Mutex */ void Unlock() { #ifndef NDEBUG debug_mutex.Lock(); assert(locked); assert(owner.IsInside()); locked = false; debug_mutex.Unlock(); #endif mutex.Unlock(); #ifndef NDEBUG --thread_locks_held; #endif }
void WakeUp() { if (!thread.IsInside()) event_pipe.Signal(); }
/** * Returns the monotonic clock in microseconds. This method is only * available in the main thread. */ gcc_pure uint64_t ClockUS() const { assert(thread.IsInside()); return now_us; }
bool InMainThread() { return main_thread.IsInside(); }