diff --git a/tile/base/thread/cond_var.h b/tile/base/thread/cond_var.h index 9118a03..41e1d73 100644 --- a/tile/base/thread/cond_var.h +++ b/tile/base/thread/cond_var.h @@ -113,6 +113,7 @@ private: } private: + friend class ScopedLock; CondVarProxy proxy_; }; }// namespace cond_var diff --git a/tile/base/thread/event.h b/tile/base/thread/event.h index 61f9c2b..8386191 100644 --- a/tile/base/thread/event.h +++ b/tile/base/thread/event.h @@ -3,7 +3,6 @@ #pragma once -#include "tile/base/thread/cond_var.h" #include "tile/base/thread/mutex.h" #include "tile/base/thread/scoped_lock.h" @@ -30,7 +29,7 @@ public: inline void Wait() { ScopedLock _(m_); - cv_.Wait(m_, [this] { return signaled_; }); + cv_.Wait(_, [this] { return signaled_; }); ResetIfNeeded(); } @@ -49,7 +48,7 @@ public: bool WaitUntil(const std::chrono::time_point &timeout_time) { ScopedLock _(m_); - if (cv_.WaitUntil(m_, timeout_time, [this] { return signaled_; })) { + if (cv_.WaitUntil(_, timeout_time, [this] { return signaled_; })) { ResetIfNeeded(); return true; } diff --git a/tile/tile.h b/tile/tile.h index de94d47..e05523a 100644 --- a/tile/tile.h +++ b/tile/tile.h @@ -39,7 +39,6 @@ #include "tile/base/write_mostly.h" // Sync -#include "tile/base/thread/cond_var.h" #include "tile/base/thread/event.h" #include "tile/base/thread/latch.h" #include "tile/base/thread/mutex.h"