soup: fix start/stop race in souphttpclientsink
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 10 Dec 2011 14:48:57 +0000 (14:48 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 11 Dec 2011 17:24:20 +0000 (17:24 +0000)
commit5bb4dcd89c73296062d9de49d1493fb3b5439154
tree203f1190d150338e2aa7e537833fbfa62967df3d
parenta65091802fc1458c372687195d779ddba682d376
soup: fix start/stop race in souphttpclientsink

Fix crash or hang in generic/states unit test when doing stop()
right after start(). Create main loop in the start function already
and not just in the thread function, so that stop() always has a
valid main loop to quit on. Also, calling g_main_loop_quit() before
g_main_loop_run() won't work and result in the stop function waiting
for the thread to join forever. Therefore, wait for the thread to
be ready and get the main loop running in the start() function, to
be sure stop() always works.
ext/soup/gstsouphttpclientsink.c