From: Sebastian B. <sb...@us...> - 2013-12-24 09:25:49
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv304/gtk Modified Files: subthreads.c Log Message: Removed obsolete gtk-based ipc communication. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- subthreads.c 24 Dec 2013 09:25:29 -0000 1.52 +++ subthreads.c 24 Dec 2013 09:25:47 -0000 1.53 @@ -51,19 +51,6 @@ /** Mutex for accessing thread list */ static GMutex *thread_list_mutex; -struct ipc_message -{ - int async; - int string; - int rc; - void *function; - int argcount; - void *arg1; - void *arg2; - void *arg3; - void *arg4; -}; - struct thread_s { struct node node; @@ -142,41 +129,6 @@ return 1; } -static void thread_input(gpointer data, gint source, GdkInputCondition condition) -{ - int len; - struct ipc_message msg; - - len = read(source,&msg,sizeof(msg)); - - if (len == sizeof(msg)) - { - int rc = 0; - - switch (msg.argcount) - { - case 0: rc = ((int (*)(void))msg.function)();break; - case 1: rc = ((int (*)(void*))msg.function)(msg.arg1);break; - case 2: rc = ((int (*)(void*,void*))msg.function)(msg.arg1,msg.arg2);break; - case 3: rc = ((int (*)(void*,void*,void*))msg.function)(msg.arg1,msg.arg2,msg.arg3);break; - case 4: rc = ((int (*)(void*,void*,void*,void*))msg.function)(msg.arg1,msg.arg2,msg.arg3,msg.arg4);break; - } - - if (msg.async) - { - if (msg.string) - { - free(msg.arg1); - } - } else - { - /* synchron call, deliver return code */ - msg.rc = rc; - write(sockets[0],&msg,sizeof(msg)); - } - } -} - /***************************************************************************************/ /** Structure that is passed to newly created threads via thread_add() */ @@ -255,20 +207,8 @@ int thread_start(int (*entry)(void*), void *udata) { - if (!input_added) - { - gtk_input_add_full(sockets[0],GDK_INPUT_READ,thread_input, NULL, NULL, NULL); - input_added = 1; - } - - if ((g_thread_create((GThreadFunc)entry,udata,TRUE,NULL))) - { - g_mutex_lock(thread_mutex); - g_cond_wait(thread_cond,thread_mutex); - g_mutex_unlock(thread_mutex); - return 1; - } - return 0; + fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); + exit(1); } /***************************************************************************************/ |