[gthumb/ext] set to terminated when the thread exits
- From: Paolo Bacchilega <paobac src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gthumb/ext] set to terminated when the thread exits
- Date: Sun, 20 Sep 2009 17:08:49 +0000 (UTC)
commit e421b0de1af7aac39a5f375604dd97365d463220
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Sep 20 19:06:46 2009 +0200
set to terminated when the thread exits
gthumb/gth-async-task.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/gthumb/gth-async-task.c b/gthumb/gth-async-task.c
index 0c5262e..e0291df 100644
--- a/gthumb/gth-async-task.c
+++ b/gthumb/gth-async-task.c
@@ -111,6 +111,22 @@ update_progress (gpointer data)
}
+static gpointer
+exec_task (gpointer user_data)
+{
+ GthAsyncTask *self = user_data;
+ gpointer result;
+
+ result = self->priv->exec_func (self);
+
+ g_mutex_lock (self->priv->data_mutex);
+ self->priv->terminated = TRUE;
+ g_mutex_unlock (self->priv->data_mutex);
+
+ return result;
+}
+
+
static void
gth_async_task_exec (GthTask *task)
{
@@ -120,7 +136,7 @@ gth_async_task_exec (GthTask *task)
if (self->priv->before_func != NULL)
self->priv->before_func (self);
- g_thread_create (self->priv->exec_func, self, FALSE, NULL);
+ g_thread_create (exec_task, self, FALSE, NULL);
self->priv->progress_event = g_timeout_add (PROGRESS_DELAY, update_progress, self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]