Commit b3a33f06 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Check the callback list before waiting.

Some callbacks may be pushed during pipeline initialization and before the dispatch thread is actually started and waiting for them, which sometimes causes some hangs. This fixes Fallout 3 and Panzer Corps -and possibly others- intro videos hanging forever. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 032d848a
......@@ -66,15 +66,11 @@ static DWORD WINAPI dispatch_thread(void *user)
while (1)
{
pthread_cond_wait(&cb_list_cond, &cb_list_lock);
while (list_empty(&cb_list)) pthread_cond_wait(&cb_list_cond, &cb_list_lock);
while (!list_empty(&cb_list))
{
cbdata = LIST_ENTRY(list_head(&cb_list), struct cb_data, entry);
list_remove(&cbdata->entry);
TrySubmitThreadpoolCallback(&perform_cb, cbdata, NULL);
}
cbdata = LIST_ENTRY(list_head(&cb_list), struct cb_data, entry);
list_remove(&cbdata->entry);
TrySubmitThreadpoolCallback(&perform_cb, cbdata, NULL);
}
pthread_mutex_unlock(&cb_list_lock);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment