audio: Fix Effect worker thread

When a effect is closed and reopened from framework,
mExit and mStop states are not reset,that causes
threadloop to exit and eventually blocks framework
as FMQs are never filled from effects HAL.

Reset the state of mExit and mStop on every time when
thread is created, so open->close->open kind of
scenarios can be handled.

Bug: 301214647
Test: run vts-hal-audio

Change-Id: If54c8fa62827e5f28e620dd841d638028149b1b8
This commit is contained in:
Jaideep Sharma
2023-09-20 11:43:17 +05:30
parent 801c76b13e
commit 632b1cd048

View File

@@ -48,6 +48,8 @@ RetCode EffectThread::createThread(std::shared_ptr<EffectContext> context, const
mPriority = priority;
{
std::lock_guard lg(mThreadMutex);
mStop = true;
mExit = false;
mThreadContext = std::move(context);
auto statusMQ = mThreadContext->getStatusFmq();
EventFlag* efGroup = nullptr;