diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-10-13 06:22:29 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-10-13 06:22:29 +0000 |
commit | 996fee475e501a991ff04548abf1d9a5ff311d89 (patch) | |
tree | 56edd44200c14b391bec6fae772a53f8cf362ac3 /libsylph/imap.c | |
parent | 9442a550896bbc164a13c8e2f25d9674ca86fd2a (diff) |
use g_atomic_int_{get,set} for thread terminate flags.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2282 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/imap.c')
-rw-r--r-- | libsylph/imap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libsylph/imap.c b/libsylph/imap.c index 198bbc72..129c0485 100644 --- a/libsylph/imap.c +++ b/libsylph/imap.c @@ -4775,7 +4775,7 @@ static void imap_thread_run_proxy(gpointer push_data, gpointer data) g_print("imap_thread_run_proxy (%p): calling thread_func\n", g_thread_self()); real->retval = real->thread_func(IMAP_SESSION(real), real->thread_data); - real->flag = 1; + g_atomic_int_set(&real->flag, 1); g_print("imap_thread_run_proxy (%p): thread_func done\n", g_thread_self()); g_main_context_wakeup(NULL); } @@ -4806,7 +4806,7 @@ static gint imap_thread_run(IMAPSession *session, IMAPThreadFunc func, g_thread_pool_push(real->pool, real, NULL); - while (real->flag == 0) + while (g_atomic_int_get(&real->flag) == 0) event_loop_iterate(); real->is_running = FALSE; @@ -4850,7 +4850,7 @@ static gint imap_thread_run_progress(IMAPSession *session, IMAPThreadFunc func, g_thread_pool_push(real->pool, real, NULL); - while (real->flag == 0) { + while (g_atomic_int_get(&real->flag) == 0) { event_loop_iterate(); if (prev_count != real->prog_count && real->prog_total > 0) { progress_func(session, real->prog_count, |