OSDN Git Service
ffmpeg-extractor: Fix deadlock when stopping the reader thread
You cannot hold the lock used by the reader thread when trying
to join to the reader thread!
For example, if we start and then stop the reader thread
before it gets a chance to execute, one thread will be in
stopReaderThread calling pthread_thread_join (and holding mLock).
Then the reader thread will execute and immediately block on
mLock (it gets the lock immediately on startup).
Instead, release the lock while we wait for the thread to exit
and then reacquire the lock.
Change-Id: I9247ae48586c18f4eb7a4f74e188b9d4f88824e2