|author||wm4 <wm4@nowhere>||2018-04-15 15:09:41 +0200|
|committer||Jan Ekström <firstname.lastname@example.org>||2018-04-16 01:22:05 +0300|
client API: fix potential sporadic freezes on termination
Although this was never observed to be happening, it seems definitely possible: we first tell the main thread to exit, and then we ask the main thread to do some work for us (with mp_dispatch_run()). Obviously this is racy, and the main thread could exit without doing this, which would block mp_dispatch_run() forever. Fix this by changing the order of operation, so that it makes sense. We could also just store the pthread_t of the main thread in some variable, but the fact that pthread_create() might set the pthread_t argument _after_ starting the thread makes this a bit messy (at least it doesn't seem to be guaranteed on a superficial look at the manpage).
Diffstat (limited to 'demux')
0 files changed, 0 insertions, 0 deletions