thread-pool: avoid race in shutdown
authorWim Taymans <wim.taymans@gmail.com>
Tue, 12 Nov 2013 09:28:55 +0000 (10:28 +0100)
committerWim Taymans <wim.taymans@gmail.com>
Tue, 12 Nov 2013 09:28:55 +0000 (10:28 +0100)
commitc4ae13dbb50760d408ed027db3e4ffa009b063ac
tree33c4b5ef9604648abb9742b138948d331a30742c
parenta2eb48a27c4a68e1cbadf5a57055ac15046014c3
thread-pool: avoid race in shutdown

If we call g_main_loop_quit before the thread has entered g_main_loop_run, we
don't actually stop the mainloop ever. Solve this race by adding an idle source
to the mainloop that calls the _quit. This way we immediately exit the mainloop
if quit was called before we started it.
gst/rtsp-server/rtsp-thread-pool.c