Exemple #1
0
  /**
   * 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
  }
Exemple #2
0
 void WakeUp() {
     if (!thread.IsInside())
         event_pipe.Signal();
 }
Exemple #3
0
    /**
     * 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;
    }
Exemple #4
0
bool
InMainThread()
{
  return main_thread.IsInside();
}