Repository navigation
How to notify the main thread when playback is finished? #458
Answered
by
mackron
ahmadharis4u
asked this question in
Q&A
|
I want the uninits to occur automatically from the Main thread after the playback is finished by the worker. |
Answered by
mackron
Apr 20, 2022
Replies: 1 comment 2 replies
|
No, you need to manage that yourself. It's just standard multi-threaded notification stuff. Set a variable or signal some kind of synchronization primitive that the main thread is continuously monitoring. When the variable is set, or the sync primitive is signalled, have the main thread do the uninit process. Alternatively, consider using the high level API which will allow you to skip the data callback completely. |
2 replies
Answer selected by
ahmadharis4u
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, you need to manage that yourself. It's just standard multi-threaded notification stuff. Set a variable or signal some kind of synchronization primitive that the main thread is continuously monitoring. When the variable is set, or the sync primitive is signalled, have the main thread do the uninit process.
Alternatively, consider using the high level API which will allow you to skip the data callback completely.