Commit d20170ed authored by Ell's avatar Ell

app: in gimp-parallel, fix async-thread shutdown

... to prevent a potential deadlock.

(cherry picked from commit ff679c66)
parent 7b3ecb80
......@@ -454,6 +454,7 @@ gimp_parallel_run_async_set_n_threads (gint n_threads)
gimp_parallel_run_async_n_threads = n_threads;
}
static gpointer
gimp_parallel_run_async_thread_func (GimpParallelRunAsyncThread *thread)
{
......@@ -463,10 +464,10 @@ gimp_parallel_run_async_thread_func (GimpParallelRunAsyncThread *thread)
{
GimpParallelRunAsyncTask *task;
if (thread->quit)
break;
while ((task = (GimpParallelRunAsyncTask *) g_queue_pop_head (&gimp_parallel_run_async_queue)))
while (! thread->quit &&
(task =
(GimpParallelRunAsyncTask *) g_queue_pop_head (
&gimp_parallel_run_async_queue)))
{
g_object_set_data (G_OBJECT (task->async),
"gimp-parallel-run-async-link", NULL);
......@@ -478,6 +479,9 @@ gimp_parallel_run_async_thread_func (GimpParallelRunAsyncThread *thread)
g_mutex_lock (&gimp_parallel_run_async_mutex);
}
if (thread->quit)
break;
g_cond_wait (&gimp_parallel_run_async_cond,
&gimp_parallel_run_async_mutex);
}
......
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