Revision 2282

libsylph/utils.c (revision 2282)
3881 3881

  
3882 3882
	debug_print("execute_command_line_async_func: exec done: %s\n",
3883 3883
		    cmd_data->cmdline);
3884
	cmd_data->flag = 1;
3884
	g_atomic_int_set(&cmd_data->flag, 1);
3885 3885
	g_main_context_wakeup(NULL);
3886 3886

  
3887 3887
	return GINT_TO_POINTER(0);
......
3909 3909
		return -1;
3910 3910

  
3911 3911
	debug_print("execute_command_line_async_wait: waiting thread\n");
3912
	while (data.flag == 0)
3912
	while (g_atomic_int_get(&data.flag) == 0)
3913 3913
		event_loop_iterate();
3914 3914

  
3915 3915
	g_thread_join(thread);
libsylph/imap.c (revision 2282)
4775 4775

  
4776 4776
	g_print("imap_thread_run_proxy (%p): calling thread_func\n", g_thread_self());
4777 4777
	real->retval = real->thread_func(IMAP_SESSION(real), real->thread_data);
4778
	real->flag = 1;
4778
	g_atomic_int_set(&real->flag, 1);
4779 4779
	g_print("imap_thread_run_proxy (%p): thread_func done\n", g_thread_self());
4780 4780
	g_main_context_wakeup(NULL);
4781 4781
}
......
4806 4806

  
4807 4807
	g_thread_pool_push(real->pool, real, NULL);
4808 4808

  
4809
	while (real->flag == 0)
4809
	while (g_atomic_int_get(&real->flag) == 0)
4810 4810
		event_loop_iterate();
4811 4811

  
4812 4812
	real->is_running = FALSE;
......
4850 4850

  
4851 4851
	g_thread_pool_push(real->pool, real, NULL);
4852 4852

  
4853
	while (real->flag == 0) {
4853
	while (g_atomic_int_get(&real->flag) == 0) {
4854 4854
		event_loop_iterate();
4855 4855
		if (prev_count != real->prog_count && real->prog_total > 0) {
4856 4856
			progress_func(session, real->prog_count,
libsylph/socket.c (revision 2282)
1332 1332
	SockConnectData *conn_data = (SockConnectData *)data;
1333 1333

  
1334 1334
	conn_data->sock = sock_connect(conn_data->hostname, conn_data->port);
1335
	conn_data->flag = 1;
1335
	g_atomic_int_set(&conn_data->flag, 1);
1336 1336

  
1337 1337
	debug_print("sock_connect_async_func: connected\n");
1338 1338
	g_main_context_wakeup(NULL);
......
1382 1382
	}
1383 1383

  
1384 1384
	debug_print("sock_connect_async_thread_wait: waiting thread\n");
1385
	while (conn_data->flag == 0)
1385
	while (g_atomic_int_get(&conn_data->flag) == 0)
1386 1386
		event_loop_iterate();
1387 1387

  
1388 1388
	g_thread_join(conn_data->thread);
src/query_search.c (revision 2282)
665 665
	g_async_queue_unref(qdata->queue);
666 666
#endif
667 667

  
668
	qdata->flag = 1;
668
	g_atomic_int_set(&qdata->flag, 1);
669 669
	g_main_context_wakeup(NULL);
670 670

  
671 671
	debug_print("query_search_folder_func end\n");
......
710 710
	thread = g_thread_create(query_search_folder_func, &data, TRUE, NULL);
711 711

  
712 712
	debug_print("query_search_folder: thread started\n");
713
	while (data.flag == 0) {
713
	while (g_atomic_int_get(&data.flag) == 0) {
714 714
		gtk_main_iteration();
715 715
		if (prev_count != data.count) {
716 716
			prev_count = data.count;
ChangeLog (revision 2282)
1
2009-10-13
2

  
3
	* libsylph/utils.c
4
	  libsylph/imap.c
5
	  libsylph/socket.c
6
	  src/query_search.c: use g_atomic_int_{get,set} for thread
7
	  terminate flags.
8

  
1 9
2009-10-09
2 10

  
3 11
	* src/send_message.c: made send dialog non-modal.

Also available in: Unified diff