Loading media/utils/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ cc_library { "-Wall", "-Wextra", "-Werror", "-Wthread-safety", ], header_libs: [ Loading media/utils/TimerThread.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -292,6 +292,7 @@ TimerThread::MonitorThread::~MonitorThread() { void TimerThread::MonitorThread::threadFunc() { std::unique_lock _l(mMutex); ::android::base::ScopedLockAssertion lock_assertion(mMutex); while (!mShouldExit) { Handle nextDeadline = INVALID_HANDLE; Handle now = INVALID_HANDLE; Loading Loading @@ -385,6 +386,7 @@ TimerThread::Handle TimerThread::MonitorThread::add( std::shared_ptr<const TimerThread::Request> TimerThread::MonitorThread::remove(Handle handle) { std::pair<std::shared_ptr<const Request>, TimerCallback> data; std::unique_lock ul(mMutex); ::android::base::ScopedLockAssertion lock_assertion(mMutex); if (const auto it = mMonitorRequests.find(handle); it != mMonitorRequests.end()) { data = std::move(it->second); Loading media/utils/include/mediautils/TimerThread.h +1 −1 Original line number Diff line number Diff line Loading @@ -297,7 +297,7 @@ class TimerThread { std::pair<std::shared_ptr<const Request>, TimerCallback>> mSecondChanceRequests GUARDED_BY(mMutex); RequestQueue& mTimeoutQueue; // locked internally, added to when request times out. RequestQueue& mTimeoutQueue GUARDED_BY(mMutex); // added to when request times out. // Worker thread variables bool mShouldExit GUARDED_BY(mMutex) = false; Loading Loading
media/utils/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ cc_library { "-Wall", "-Wextra", "-Werror", "-Wthread-safety", ], header_libs: [ Loading
media/utils/TimerThread.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -292,6 +292,7 @@ TimerThread::MonitorThread::~MonitorThread() { void TimerThread::MonitorThread::threadFunc() { std::unique_lock _l(mMutex); ::android::base::ScopedLockAssertion lock_assertion(mMutex); while (!mShouldExit) { Handle nextDeadline = INVALID_HANDLE; Handle now = INVALID_HANDLE; Loading Loading @@ -385,6 +386,7 @@ TimerThread::Handle TimerThread::MonitorThread::add( std::shared_ptr<const TimerThread::Request> TimerThread::MonitorThread::remove(Handle handle) { std::pair<std::shared_ptr<const Request>, TimerCallback> data; std::unique_lock ul(mMutex); ::android::base::ScopedLockAssertion lock_assertion(mMutex); if (const auto it = mMonitorRequests.find(handle); it != mMonitorRequests.end()) { data = std::move(it->second); Loading
media/utils/include/mediautils/TimerThread.h +1 −1 Original line number Diff line number Diff line Loading @@ -297,7 +297,7 @@ class TimerThread { std::pair<std::shared_ptr<const Request>, TimerCallback>> mSecondChanceRequests GUARDED_BY(mMutex); RequestQueue& mTimeoutQueue; // locked internally, added to when request times out. RequestQueue& mTimeoutQueue GUARDED_BY(mMutex); // added to when request times out. // Worker thread variables bool mShouldExit GUARDED_BY(mMutex) = false; Loading