summaryrefslogtreecommitdiff
path: root/tumblerd/tumbler-group-scheduler.c
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis@xfce.org>2009-10-08 13:38:39 +0200
committerJannis Pohlmann <jannis@xfce.org>2009-10-08 13:38:39 +0200
commitf583df4a3bf353ad577723c5fce538b872fd9e47 (patch)
tree7a86d62f0de6cbcabc62fd349097bacc03707118 /tumblerd/tumbler-group-scheduler.c
parentf2be883615ab5e226cd0b377ac8a83b3701cb768 (diff)
downloadtumbler-f583df4a3bf353ad577723c5fce538b872fd9e47.tar.gz
Wrap request unqueued check with the mutex to make the check atomic.
Diffstat (limited to 'tumblerd/tumbler-group-scheduler.c')
-rw-r--r--tumblerd/tumbler-group-scheduler.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tumblerd/tumbler-group-scheduler.c b/tumblerd/tumbler-group-scheduler.c
index c97f97f..8429cfa 100644
--- a/tumblerd/tumbler-group-scheduler.c
+++ b/tumblerd/tumbler-group-scheduler.c
@@ -370,25 +370,25 @@ tumbler_group_scheduler_thread (gpointer data,
g_signal_emit_by_name (request->scheduler, "started", request->handle);
/* finish the request if it was unqueued */
+ g_mutex_lock (scheduler->mutex);
if (request->unqueued)
{
- g_mutex_lock (scheduler->mutex);
tumbler_group_scheduler_finish_request (scheduler, request);
- g_mutex_unlock (scheduler->mutex);
return;
}
+ g_mutex_unlock (scheduler->mutex);
/* process URI by URI */
for (n = 0; request->uris[n] != NULL; ++n)
{
/* finish the request if it was unqueued */
+ g_mutex_lock (scheduler->mutex);
if (request->unqueued)
{
- g_mutex_lock (scheduler->mutex);
tumbler_group_scheduler_finish_request (scheduler, request);
- g_mutex_unlock (scheduler->mutex);
return;
}
+ g_mutex_unlock (scheduler->mutex);
/* create a file infor for the current URI */
info = tumbler_file_info_new (request->uris[n]);
@@ -485,13 +485,13 @@ tumbler_group_scheduler_thread (gpointer data,
n = GPOINTER_TO_INT (lp->data);
/* finish the request if it was unqueued */
+ g_mutex_lock (scheduler->mutex);
if (request->unqueued)
{
- g_mutex_lock (scheduler->mutex);
tumbler_group_scheduler_finish_request (scheduler, request);
- g_mutex_unlock (scheduler->mutex);
return;
}
+ g_mutex_unlock (scheduler->mutex);
/* connect to the error signal of the thumbnailer */
g_signal_connect (request->thumbnailers[n], "error",