Loading media/utils/Android.bp +7 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,13 @@ cc_library { logtags: ["EventLogTags.logtags"], cflags: [ "-Wall", "-Wextra", "-Werror", "-Wthread-safety", ], export_shared_lib_headers: [ "libpermission", ], Loading media/utils/TimerThread.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,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 @@ -381,6 +382,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 @@ -340,7 +340,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 +7 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,13 @@ cc_library { logtags: ["EventLogTags.logtags"], cflags: [ "-Wall", "-Wextra", "-Werror", "-Wthread-safety", ], export_shared_lib_headers: [ "libpermission", ], Loading
media/utils/TimerThread.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,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 @@ -381,6 +382,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 @@ -340,7 +340,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