mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:09:42 +00:00
Notify FilterCallbackScheduler to wake up it while stopping.
Bug: 183057734 Test: atest android.media.tv.tuner.cts Change-Id: I2b9d45fa7df3f2490893cc24d98c0e0baaaf0c2c
This commit is contained in:
committed by
Hongguang Chen
parent
bdd3958912
commit
74bc43bdc2
@@ -88,7 +88,11 @@ void FilterCallbackScheduler::start() {
|
||||
}
|
||||
|
||||
void FilterCallbackScheduler::stop() {
|
||||
mIsRunning = false;
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mLock);
|
||||
mIsRunning = false;
|
||||
mCv.notify_all();
|
||||
}
|
||||
if (mCallbackThread.joinable()) {
|
||||
mCallbackThread.join();
|
||||
}
|
||||
@@ -113,6 +117,10 @@ void FilterCallbackScheduler::threadLoopOnce() {
|
||||
// okay to send data.
|
||||
mCv.wait(lock);
|
||||
}
|
||||
if (!mIsRunning) {
|
||||
lock.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
// condition_variable wait locks mutex on timeout / notify
|
||||
if (!mCallbackBuffer.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user