Update of /cvsroot/simplemail/simplemail/gtk
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31732/gtk
Modified Files:
subthreads.c
Log Message:
Removed old non-nested loop variant.
Index: subthreads.c
===================================================================
RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- subthreads.c 24 Dec 2013 09:17:08 -0000 1.45
+++ subthreads.c 24 Dec 2013 09:17:23 -0000 1.46
@@ -35,9 +35,6 @@
#include "support_indep.h"
#include "subthreads.h"
-/* Define to allow nested loops */
-/*#define ALLOW_NESTED_LOOPS*/
-
static GCond *thread_cond;
static GMutex *thread_mutex;
@@ -290,12 +287,7 @@
uintptr_t rc;
-#ifdef ALLOW_NESTED_LOOPS
thread_t caller;
-#else
- GCond *sync_cond;
- GMutex *sync_mutex;
-#endif
};
/* FIXME: Note that if the args are not passed in a register, but e.g., on the stack this doesn't need to
@@ -317,13 +309,7 @@
case 6: rc = ((int (*)(void*,void*,void*,void*,void*,void*))data->function)(data->arg[0],data->arg[1],data->arg[2],data->arg[3],data->arg[4],data->arg[5]);break;
}
data->rc = rc;
-#ifdef ALLOW_NESTED_LOOPS
g_main_loop_quit(data->caller->main_loop);
-#else
- g_mutex_lock(data->sync_mutex);
- g_cond_signal(data->sync_cond);
- g_mutex_unlock(data->sync_mutex);
-#endif
return 0;
}
@@ -337,31 +323,14 @@
data.function = (int (*)(void))function;
data.argcount = argcount;
-#ifdef ALLOW_NESTED_LOOPS
data.caller = thread_get();
-#else
- data.sync_cond = g_cond_new();
- data.sync_mutex = g_mutex_new();
- assert(data.sync_cond);
- assert(data.sync_mutex);
-#endif
for (i=0; i < argcount; i++)
data.arg[i] = va_arg(argptr, void *);
-#ifndef ALLOW_NESTED_LOOPS
- g_mutex_lock(data.sync_mutex);
-#endif
g_main_context_invoke(thread->context, thread_call_function_sync_entry, &data);
-#ifdef ALLOW_NESTED_LOOPS
g_main_loop_run(data.caller->main_loop);
-#else
- g_cond_wait(data.sync_cond, data.sync_mutex);
- g_mutex_unlock(data.sync_mutex);
- g_cond_free(data.sync_cond);
- g_mutex_free(data.sync_mutex);
-#endif
if (rc) *rc = data.rc;
return 0;
|