You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(65) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(61) |
Feb
(111) |
Mar
(98) |
Apr
(33) |
May
(31) |
Jun
(64) |
Jul
(35) |
Aug
(50) |
Sep
(170) |
Oct
(89) |
Nov
(72) |
Dec
(214) |
2002 |
Jan
(74) |
Feb
(21) |
Mar
(5) |
Apr
(4) |
May
(61) |
Jun
(13) |
Jul
(3) |
Aug
(39) |
Sep
(14) |
Oct
(80) |
Nov
(22) |
Dec
(76) |
2003 |
Jan
(14) |
Feb
(59) |
Mar
(7) |
Apr
(5) |
May
|
Jun
(4) |
Jul
(6) |
Aug
(78) |
Sep
(68) |
Oct
(23) |
Nov
(25) |
Dec
(107) |
2004 |
Jan
(82) |
Feb
(75) |
Mar
(13) |
Apr
(9) |
May
(21) |
Jun
(2) |
Jul
(1) |
Aug
(52) |
Sep
(23) |
Oct
(15) |
Nov
(6) |
Dec
(60) |
2005 |
Jan
(125) |
Feb
(94) |
Mar
(32) |
Apr
(68) |
May
|
Jun
|
Jul
(11) |
Aug
(3) |
Sep
(15) |
Oct
(3) |
Nov
|
Dec
(58) |
2006 |
Jan
(46) |
Feb
(29) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(9) |
Dec
(9) |
2007 |
Jan
(62) |
Feb
(60) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(6) |
Aug
(3) |
Sep
(4) |
Oct
(2) |
Nov
(4) |
Dec
(46) |
2008 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(10) |
Dec
(49) |
2009 |
Jan
(14) |
Feb
(12) |
Mar
(37) |
Apr
(8) |
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(25) |
Oct
(48) |
Nov
(7) |
Dec
(45) |
2010 |
Jan
(15) |
Feb
(14) |
Mar
(7) |
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(28) |
Nov
|
Dec
(44) |
2011 |
Jan
(22) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(70) |
2012 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(128) |
2013 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(2) |
Dec
(150) |
2014 |
Jan
(70) |
Feb
(44) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sebastian B. <sb...@us...> - 2013-12-24 08:55:51
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28411/gtk Modified Files: subthreads.c Log Message: Added a timer event only if a callback has been specified. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- subthreads.c 24 Dec 2013 08:55:32 -0000 1.26 +++ subthreads.c 24 Dec 2013 08:55:49 -0000 1.27 @@ -365,10 +365,13 @@ data.timer_callback = (void (*)(void*))timer_callback; data.timer_data = timer_data; - GSource *s = g_timeout_source_new(1); - g_source_set_callback(s, thread_wait_timer_entry, &data, NULL); - g_source_attach(s, t->context); - g_source_unref(s); + if (timer_callback) + { + GSource *s = g_timeout_source_new(1); + g_source_set_callback(s, thread_wait_timer_entry, &data, NULL); + g_source_attach(s, t->context); + g_source_unref(s); + } g_main_loop_run(t->main_loop); |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:55:34
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28387/gtk Modified Files: subthreads.c Log Message: Simple implementation for thread_abort(). Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- subthreads.c 24 Dec 2013 08:54:59 -0000 1.25 +++ subthreads.c 24 Dec 2013 08:55:32 -0000 1.26 @@ -225,8 +225,7 @@ void thread_abort(thread_t thread) { - fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); - exit(1); + g_main_loop_quit(thread->main_loop); } /***************************************************************************************/ |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:55:02
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28328/gtk Modified Files: subthreads.c Log Message: Implemented the timer callback feature for thread_wait(). Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- subthreads.c 24 Dec 2013 08:54:35 -0000 1.24 +++ subthreads.c 24 Dec 2013 08:54:59 -0000 1.25 @@ -341,12 +341,36 @@ /***************************************************************************************/ +struct thread_wait_timer_entry_data +{ + void (*timer_callback)(void*); + void *timer_data; +}; + +static gboolean thread_wait_timer_entry(gpointer udata) +{ + struct thread_wait_timer_entry_data *data = (struct thread_wait_timer_entry_data*)udata; + data->timer_callback(data->timer_data); + return 1; +} + int thread_wait(void (*timer_callback(void*)), void *timer_data, int millis) { + struct thread_wait_timer_entry_data data; struct thread_s *t; + memset(&data, 0, sizeof(data)); + t = thread_get(); + data.timer_callback = (void (*)(void*))timer_callback; + data.timer_data = timer_data; + + GSource *s = g_timeout_source_new(1); + g_source_set_callback(s, thread_wait_timer_entry, &data, NULL); + g_source_attach(s, t->context); + g_source_unref(s); + g_main_loop_run(t->main_loop); return 0; |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:54:38
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28295/gtk Modified Files: subthreads.c Log Message: Initialize some other fields of the main thread. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- subthreads.c 24 Dec 2013 08:53:47 -0000 1.23 +++ subthreads.c 24 Dec 2013 08:54:35 -0000 1.24 @@ -76,6 +76,7 @@ int init_threads(void) { + /* TODO: Proper bailout on failure */ if (!g_thread_supported ()) g_thread_init (NULL); if (!(thread_cond = g_cond_new())) return 0; if (!(thread_mutex = g_mutex_new())) return 0; @@ -85,6 +86,11 @@ socketpair(PF_LOCAL,SOCK_DGRAM,0,sockets); main_thread.thread = g_thread_self(); + if (!(main_thread.context = g_main_context_new())) + return 0; + if (!(main_thread.main_loop = g_main_loop_new(main_thread.context, FALSE))) + return 0; + return 1; } |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:53:50
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28233/gtk Modified Files: subthreads.c Log Message: Function thread_get() should now also work for the main thread. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- subthreads.c 24 Dec 2013 08:53:28 -0000 1.22 +++ subthreads.c 24 Dec 2013 08:53:47 -0000 1.23 @@ -84,6 +84,7 @@ socketpair(PF_LOCAL,SOCK_DGRAM,0,sockets); + main_thread.thread = g_thread_self(); return 1; } @@ -316,6 +317,9 @@ struct thread_s *t; GThread *gt = g_thread_self(); + if (gt == main_thread.thread) + return &main_thread; + g_mutex_lock(thread_list_mutex); t = (struct thread_s*)list_first(&thread_list); while (t) |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:53:30
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28207/gtk Modified Files: subthreads.c Log Message: Implemented naive version of thread_get_main(). Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- subthreads.c 24 Dec 2013 08:51:51 -0000 1.21 +++ subthreads.c 24 Dec 2013 08:53:28 -0000 1.22 @@ -70,6 +70,8 @@ GMainLoop *main_loop; }; +static struct thread_s main_thread; + /***************************************************************************************/ int init_threads(void) @@ -302,6 +304,13 @@ /***************************************************************************************/ +thread_t thread_get_main(void) +{ + return (thread_t)&main_thread; +} + +/***************************************************************************************/ + thread_t thread_get(void) { struct thread_s *t; |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:53:10
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28183/tests Modified Files: imap2_unittest.c Log Message: Init progmon subsystem. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- imap2_unittest.c 24 Dec 2013 08:52:48 -0000 1.5 +++ imap2_unittest.c 24 Dec 2013 08:53:07 -0000 1.6 @@ -44,6 +44,7 @@ CU_ASSERT(codesets_init() != 0); CU_ASSERT(init_threads() != 0); + CU_ASSERT(progmon_init() != 0); CU_ASSERT(load_config() != 0); CU_ASSERT(init_folders() != 0); @@ -83,6 +84,7 @@ del_folders(); free_config(); + progmon_deinit(); cleanup_threads(); codesets_cleanup(); } |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:52:50
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28141/tests Modified Files: imap2_unittest.c Log Message: Init and cleanup codeset stuff. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- imap2_unittest.c 24 Dec 2013 08:52:27 -0000 1.4 +++ imap2_unittest.c 24 Dec 2013 08:52:48 -0000 1.5 @@ -41,6 +41,8 @@ config_set_user_profile_directory("imap-profile"); + CU_ASSERT(codesets_init() != 0); + CU_ASSERT(init_threads() != 0); CU_ASSERT(load_config() != 0); @@ -82,6 +84,7 @@ del_folders(); free_config(); cleanup_threads(); + codesets_cleanup(); } /*************************************************************/ |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:52:29
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28105/tests Modified Files: imap2_unittest.c Log Message: Init debug subsystem. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- imap2_unittest.c 14 Dec 2013 05:50:30 -0000 1.3 +++ imap2_unittest.c 24 Dec 2013 08:52:27 -0000 1.4 @@ -36,6 +36,9 @@ struct account *ac; struct folder *f; + debug_init(); + debug_set_level(25); + config_set_user_profile_directory("imap-profile"); CU_ASSERT(init_threads() != 0); |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:52:10
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27987/gtk Modified Files: support.c Log Message: Implemented sm_put_on_serial_line() using writing messages to stderr. Index: support.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/support.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- support.c 10 Dec 2012 07:10:15 -0000 1.14 +++ support.c 24 Dec 2013 08:52:07 -0000 1.15 @@ -504,3 +504,9 @@ return rc; } +/***************************************************************************************/ + +void sm_put_on_serial_line(char *txt) +{ + fprintf(stderr,"%s", txt); +} |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:51:53
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27943/gtk Modified Files: subthreads.c Log Message: Function thread_push_function_entry() can be static. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- subthreads.c 24 Dec 2013 08:51:16 -0000 1.20 +++ subthreads.c 24 Dec 2013 08:51:51 -0000 1.21 @@ -335,7 +335,7 @@ /***************************************************************************************/ -gboolean thread_push_function_entry(gpointer user_data) +static gboolean thread_push_function_entry(gpointer user_data) { struct thread_call_function_sync_data *data = (struct thread_call_function_sync_data*)user_data; |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:51:35
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27914 Modified Files: debug.h Log Message: Added non-debug version of SM_RETURN(). Index: debug.h =================================================================== RCS file: /cvsroot/simplemail/simplemail/debug.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- debug.h 24 Dec 2009 15:29:54 -0000 1.12 +++ debug.h 24 Dec 2013 08:51:32 -0000 1.13 @@ -48,6 +48,7 @@ #define SM_DEBUGF(level,x) #define SM_ENTER #define SM_LEAVE +#define SM_RETURN(val,type) #else extern int __debuglevel; #ifdef __GNUC__ |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:51:18
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27882/gtk Modified Files: subthreads.c Log Message: Implemented thread_push_function() in a naive fashion. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- subthreads.c 24 Dec 2013 08:50:33 -0000 1.19 +++ subthreads.c 24 Dec 2013 08:51:16 -0000 1.20 @@ -335,12 +335,59 @@ /***************************************************************************************/ +gboolean thread_push_function_entry(gpointer user_data) +{ + struct thread_call_function_sync_data *data = (struct thread_call_function_sync_data*)user_data; + + switch (data->argcount) + { + case 0: data->function(); break; + case 1: ((int (*)(void*))data->function)(data->arg[0]);break; + case 2: ((int (*)(void*,void*))data->function)(data->arg[0],data->arg[1]);break; + case 3: ((int (*)(void*,void*,void*))data->function)(data->arg[0],data->arg[1],data->arg[2]);break; + case 4: ((int (*)(void*,void*,void*,void*))data->function)(data->arg[0],data->arg[1],data->arg[2],data->arg[3]);break; + case 5: ((int (*)(void*,void*,void*,void*,void*))data->function)(data->arg[0],data->arg[1],data->arg[2],data->arg[3],data->arg[4]);break; + case 6: ((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; + } + free(data); + return FALSE; +} + int thread_push_function(void *function, int argcount, ...) { - int rc = 0; - fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); - exit(1); - return rc; + struct thread_call_function_sync_data *data; + int i; + + va_list argptr; + + if (!(data = malloc(sizeof(*data)))) + return 0; + memset(data, 0, sizeof(*data)); + + assert(argcount < THREAD_CALL_FUNCTION_SYNC_DATA_NUM_ARGS); + + va_start(argptr,argcount); + + data->function = (int (*)(void))function; + data->argcount = argcount; + data->sync_cond = g_cond_new(); + data->sync_mutex = g_mutex_new(); + + assert(data->sync_cond); + assert(data->sync_mutex); + + for (i=0; i < argcount; i++) + data->arg[i] = va_arg(argptr, void *); + + va_end (argptr); + + + GSource *s = g_timeout_source_new(1); + g_source_set_callback(s, thread_push_function_entry, data, NULL); + g_source_attach(s, thread_get()->context); + g_source_unref(s); + + return 1; } /***************************************************************************************/ |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:50:35
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27834/gtk Modified Files: subthreads.c Log Message: Implemented thread_call_function_sync(). Note that, if the functions works, is highly depending on the ABI. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- subthreads.c 24 Dec 2013 08:49:55 -0000 1.18 +++ subthreads.c 24 Dec 2013 08:50:33 -0000 1.19 @@ -230,31 +230,73 @@ /***************************************************************************************/ +#define THREAD_CALL_FUNCTION_SYNC_DATA_NUM_ARGS 6 + +struct thread_call_function_sync_data +{ + int (*function)(void); + int argcount; + void *arg[THREAD_CALL_FUNCTION_SYNC_DATA_NUM_ARGS]; + + GCond *sync_cond; + GMutex *sync_mutex; +}; + +/* FIXME: Note that if the args are not passed in a register, but e.g., on the stack this doesn't need to + * work depending on the ABI + */ +static gboolean thread_call_function_sync_entry(gpointer user_data) +{ + struct thread_call_function_sync_data *data = (struct thread_call_function_sync_data*)user_data; + + switch (data->argcount) + { + case 0: data->function(); break; + case 1: ((int (*)(void*))data->function)(data->arg[0]);break; + case 2: ((int (*)(void*,void*))data->function)(data->arg[0],data->arg[1]);break; + case 3: ((int (*)(void*,void*,void*))data->function)(data->arg[0],data->arg[1],data->arg[2]);break; + case 4: ((int (*)(void*,void*,void*,void*))data->function)(data->arg[0],data->arg[1],data->arg[2],data->arg[3]);break; + case 5: ((int (*)(void*,void*,void*,void*,void*))data->function)(data->arg[0],data->arg[1],data->arg[2],data->arg[3],data->arg[4]);break; + case 6: ((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; + } + g_mutex_lock(data->sync_mutex); + g_cond_signal(data->sync_cond); + g_mutex_unlock(data->sync_mutex); + + return 0; +} + int thread_call_function_sync(thread_t thread, void *function, int argcount, ...) { - fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); -// exit(1); + struct thread_call_function_sync_data data; + int i; -/* int rc; - void *arg1,*arg2,*arg3,*arg4; va_list argptr; + assert(argcount < THREAD_CALL_FUNCTION_SYNC_DATA_NUM_ARGS); + va_start(argptr,argcount); - arg1 = va_arg(argptr, void *); - arg2 = va_arg(argptr, void *); - arg3 = va_arg(argptr, void *); - arg4 = va_arg(argptr, void *); + data.function = (int (*)(void))function; + data.argcount = argcount; + data.sync_cond = g_cond_new(); + data.sync_mutex = g_mutex_new(); + + assert(data.sync_cond); + assert(data.sync_mutex); + + for (i=0; i < argcount; i++) + data.arg[i] = va_arg(argptr, void *); + + va_end (argptr); + + g_mutex_lock(data.sync_mutex); + + g_main_context_invoke(thread->context, thread_call_function_sync_entry, &data); + + g_cond_wait(data.sync_cond, data.sync_mutex); + g_mutex_unlock(data.sync_mutex); - switch (argcount) - { - case 0: return ((int (*)(void))function)();break; - case 1: return ((int (*)(void*))function)(arg1);break; - case 2: return ((int (*)(void*,void*))function)(arg1,arg2);break; - case 3: return ((int (*)(void*,void*,void*))function)(arg1,arg2,arg3);break; - case 4: return ((int (*)(void*,void*,void*,void*))function)(arg1,arg2,arg3,arg4);break; - } -*/ return 0; } |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:49:57
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27772/gtk Modified Files: subthreads.c Log Message: Implemented thread_get(). Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- subthreads.c 24 Dec 2013 08:49:03 -0000 1.17 +++ subthreads.c 24 Dec 2013 08:49:55 -0000 1.18 @@ -260,7 +260,7 @@ /***************************************************************************************/ -int thread_wait(void (*timer_callback(void*)), void *timer_data, int millis) +thread_t thread_get(void) { struct thread_s *t; GThread *gt = g_thread_self(); @@ -275,6 +275,16 @@ g_mutex_unlock(thread_list_mutex); assert(t); + return t; +} + +/***************************************************************************************/ + +int thread_wait(void (*timer_callback(void*)), void *timer_data, int millis) +{ + struct thread_s *t; + + t = thread_get(); g_main_loop_run(t->main_loop); |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:49:05
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27721/gtk Modified Files: subthreads.c Log Message: Removed some function descriptions as they are now in the header file. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- subthreads.c 14 Dec 2013 05:49:34 -0000 1.16 +++ subthreads.c 24 Dec 2013 08:49:03 -0000 1.17 @@ -70,6 +70,8 @@ GMainLoop *main_loop; }; +/***************************************************************************************/ + int init_threads(void) { if (!g_thread_supported ()) g_thread_init (NULL); @@ -83,11 +85,15 @@ return 1; } +/***************************************************************************************/ + void cleanup_threads(void) { g_mutex_free(thread_list_mutex); } +/***************************************************************************************/ + int thread_parent_task_can_contiue(void) { g_mutex_lock(thread_mutex); @@ -216,18 +222,14 @@ /***************************************************************************************/ -/* Call the function synchron, calls timer_callback on the calling process context */ int thread_call_parent_function_sync_timer_callback(void (*timer_callback)(void*), void *timer_data, int millis, void *function, int argcount, ...) { fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); exit(1); } -/************************************************************************** - Call a function in the context of the given thread synchron +/***************************************************************************************/ - NOTE: Should call thread_handle() -**************************************************************************/ int thread_call_function_sync(thread_t thread, void *function, int argcount, ...) { fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); @@ -256,10 +258,8 @@ return 0; } -/************************************************************************** - Waits until aborted and calls timer_callback periodically. It's possible - to execute functions on the threads context while in this function. -**************************************************************************/ +/***************************************************************************************/ + int thread_wait(void (*timer_callback(void*)), void *timer_data, int millis) { struct thread_s *t; @@ -281,10 +281,8 @@ return 0; } -/************************************************************************** - Pusges an function call in the function queue of the callers task context. - Return 1 for success else 0. -**************************************************************************/ +/***************************************************************************************/ + int thread_push_function(void *function, int argcount, ...) { int rc = 0; @@ -293,6 +291,7 @@ return rc; } +/***************************************************************************************/ int thread_call_parent_function_sync(int *success, void *function, int argcount, ...) { @@ -314,6 +313,8 @@ return msg.rc; } +/***************************************************************************************/ + int thread_call_parent_function_async(void *function, int argcount, ...) { struct ipc_message msg; @@ -334,7 +335,8 @@ return 0; } -/* Call the function asynchron and duplicate the first argument which us threaded at a string */ +/***************************************************************************************/ + int thread_call_parent_function_async_string(void *function, int argcount, ...) { struct ipc_message msg; @@ -355,11 +357,14 @@ return 0; } +/***************************************************************************************/ + int thread_aborted(void) { return 0; } +/***************************************************************************************/ struct semaphore_s { |
From: Sebastian B. <sb...@us...> - 2013-12-24 08:48:37
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27682/tests Modified Files: makefile Log Message: Make sure that the directory exists to which the object files are stored. Index: makefile =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/makefile,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- makefile 12 Dec 2013 21:44:29 -0000 1.23 +++ makefile 24 Dec 2013 08:48:34 -0000 1.24 @@ -32,6 +32,7 @@ text2html_unittest test-objs/%.o: ../%.c + @mkdir -p $(@D) $(CC) $(CFLAGS) -c $< -o $@ %.o: %.c |
From: Sebastian B. <sb...@us...> - 2013-12-14 05:50:33
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22588/tests Modified Files: imap2_unittest.c Log Message: Init and cleanup the thread subsystem. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- imap2_unittest.c 13 Dec 2013 18:50:42 -0000 1.2 +++ imap2_unittest.c 14 Dec 2013 05:50:30 -0000 1.3 @@ -38,6 +38,8 @@ config_set_user_profile_directory("imap-profile"); + CU_ASSERT(init_threads() != 0); + CU_ASSERT(load_config() != 0); CU_ASSERT(init_folders() != 0); @@ -76,6 +78,7 @@ del_folders(); free_config(); + cleanup_threads(); } /*************************************************************/ |
From: Sebastian B. <sb...@us...> - 2013-12-14 05:49:36
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22481/gtk Modified Files: subthreads.c Log Message: Added first version of thread_wait(). Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- subthreads.c 13 Dec 2013 21:49:45 -0000 1.15 +++ subthreads.c 14 Dec 2013 05:49:34 -0000 1.16 @@ -20,6 +20,7 @@ ** subthreads.c */ +#include <assert.h> #include <stdarg.h> #include <stdlib.h> #include <unistd.h> @@ -64,6 +65,9 @@ { struct node node; GThread *thread; + + GMainContext *context; + GMainLoop *main_loop; }; int init_threads(void) @@ -129,24 +133,56 @@ /***************************************************************************************/ +/** Structure that is passed to newly created threads via thread_add() */ +struct thread_add_data +{ + int (*entry)(void *); + void *eudata; + struct thread_s *thread; +}; + +/** + * The entry function of thread_add(). + * + * @param udata + * @return + */ +static gpointer thread_add_entry(gpointer udata) +{ + struct thread_add_data *tad = (struct thread_add_data*)udata; + + /* TODO: Catch errors and inform parent task */ + tad->thread->context = g_main_context_new(); + tad->thread->main_loop = g_main_loop_new(tad->thread->context, FALSE); + + tad->entry(tad->eudata); + return NULL; +} + thread_t thread_add(char *thread_name, int (*entry)(void *), void *eudata) { struct thread_s *t; + struct thread_add_data tad; if (!(t = malloc(sizeof(*t)))) return NULL; memset(t,0,sizeof(*t)); - if ((t->thread = g_thread_create((GThreadFunc)entry,eudata,TRUE,NULL))) + tad.entry = entry; + tad.eudata = eudata; + tad.thread = t; + + g_mutex_lock(thread_list_mutex); + list_insert_tail(&thread_list, &t->node); + g_mutex_unlock(thread_list_mutex); + + if ((t->thread = g_thread_create(thread_add_entry,&tad,TRUE,NULL))) { g_mutex_lock(thread_mutex); g_cond_wait(thread_cond,thread_mutex); g_mutex_unlock(thread_mutex); - - g_mutex_lock(thread_list_mutex); - list_insert_tail(&thread_list, &t->node); - g_mutex_unlock(thread_list_mutex); return t; } + /* TODO: Remove thread */ return NULL; } @@ -195,7 +231,7 @@ int thread_call_function_sync(thread_t thread, void *function, int argcount, ...) { fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); - exit(1); +// exit(1); /* int rc; void *arg1,*arg2,*arg3,*arg4; @@ -226,8 +262,22 @@ **************************************************************************/ int thread_wait(void (*timer_callback(void*)), void *timer_data, int millis) { - fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); - exit(1); + struct thread_s *t; + GThread *gt = g_thread_self(); + + g_mutex_lock(thread_list_mutex); + t = (struct thread_s*)list_first(&thread_list); + while (t) + { + if (t->thread == gt) break; + t = (struct thread_s*)node_next(&t->node); + } + g_mutex_unlock(thread_list_mutex); + + assert(t); + + g_main_loop_run(t->main_loop); + return 0; } |
From: Sebastian B. <sb...@us...> - 2013-12-13 21:49:47
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25545/gtk Modified Files: subthreads.c Log Message: Store threads in a thread list. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- subthreads.c 13 Dec 2013 21:40:11 -0000 1.14 +++ subthreads.c 13 Dec 2013 21:49:45 -0000 1.15 @@ -29,6 +29,7 @@ #include <glib.h> #include <gtk/gtk.h> +#include "lists.h" #include "support_indep.h" #include "subthreads.h" @@ -40,6 +41,12 @@ /* Sockets for IPC */ static int sockets[2]; +/** List of all threads */ +static struct list thread_list; + +/** Mutex for accessing thread list */ +static GMutex *thread_list_mutex; + struct ipc_message { int async; @@ -55,6 +62,7 @@ struct thread_s { + struct node node; GThread *thread; }; @@ -63,6 +71,8 @@ if (!g_thread_supported ()) g_thread_init (NULL); if (!(thread_cond = g_cond_new())) return 0; if (!(thread_mutex = g_mutex_new())) return 0; + list_init(&thread_list); + if (!(thread_list_mutex = g_mutex_new())) return 0; socketpair(PF_LOCAL,SOCK_DGRAM,0,sockets); @@ -71,6 +81,7 @@ void cleanup_threads(void) { + g_mutex_free(thread_list_mutex); } int thread_parent_task_can_contiue(void) @@ -121,13 +132,19 @@ thread_t thread_add(char *thread_name, int (*entry)(void *), void *eudata) { struct thread_s *t; + if (!(t = malloc(sizeof(*t)))) return NULL; + memset(t,0,sizeof(*t)); if ((t->thread = g_thread_create((GThreadFunc)entry,eudata,TRUE,NULL))) { g_mutex_lock(thread_mutex); g_cond_wait(thread_cond,thread_mutex); g_mutex_unlock(thread_mutex); + + g_mutex_lock(thread_list_mutex); + list_insert_tail(&thread_list, &t->node); + g_mutex_unlock(thread_list_mutex); return t; } return NULL; |
From: Sebastian B. <sb...@us...> - 2013-12-13 21:40:13
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24836/gtk Modified Files: subthreads.c Log Message: Added dedicated structure for threads. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- subthreads.c 13 Dec 2013 21:08:14 -0000 1.13 +++ subthreads.c 13 Dec 2013 21:40:11 -0000 1.14 @@ -53,6 +53,11 @@ void *arg4; }; +struct thread_s +{ + GThread *thread; +}; + int init_threads(void) { if (!g_thread_supported ()) g_thread_init (NULL); @@ -115,13 +120,15 @@ thread_t thread_add(char *thread_name, int (*entry)(void *), void *eudata) { - GThread *t; - if ((t = g_thread_create((GThreadFunc)entry,eudata,TRUE,NULL))) + struct thread_s *t; + if (!(t = malloc(sizeof(*t)))) return NULL; + + if ((t->thread = g_thread_create((GThreadFunc)entry,eudata,TRUE,NULL))) { g_mutex_lock(thread_mutex); g_cond_wait(thread_cond,thread_mutex); g_mutex_unlock(thread_mutex); - return (thread_t)t; + return t; } return NULL; } |
From: Sebastian B. <sb...@us...> - 2013-12-13 21:08:16
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22052 Modified Files: subthreads.c Log Message: Added more error message to functions that are not implemented yet. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- subthreads.c 13 Dec 2013 21:04:12 -0000 1.12 +++ subthreads.c 13 Dec 2013 21:08:14 -0000 1.13 @@ -150,7 +150,7 @@ void thread_abort(thread_t thread) { - fprintf(stderr, "%s not implemented yet!\n", __PRETTY_FUNCTION__); + fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); exit(1); } @@ -159,7 +159,7 @@ /* Call the function synchron, calls timer_callback on the calling process context */ int thread_call_parent_function_sync_timer_callback(void (*timer_callback)(void*), void *timer_data, int millis, void *function, int argcount, ...) { - fprintf(stderr, "%s not implemented yet!\n", __PRETTY_FUNCTION__); + fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); exit(1); } @@ -170,6 +170,9 @@ **************************************************************************/ int thread_call_function_sync(thread_t thread, void *function, int argcount, ...) { + fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); + exit(1); + /* int rc; void *arg1,*arg2,*arg3,*arg4; va_list argptr; @@ -199,6 +202,8 @@ **************************************************************************/ int thread_wait(void (*timer_callback(void*)), void *timer_data, int millis) { + fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); + exit(1); return 0; } @@ -209,6 +214,8 @@ int thread_push_function(void *function, int argcount, ...) { int rc = 0; + fprintf(stderr, "%s() not implemented yet!\n", __PRETTY_FUNCTION__); + exit(1); return rc; } |
From: Sebastian B. <sb...@us...> - 2013-12-13 21:04:14
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21699 Modified Files: subthreads.c Log Message: First basic implementation of thread_add() Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- subthreads.c 13 Dec 2013 18:52:05 -0000 1.11 +++ subthreads.c 13 Dec 2013 21:04:12 -0000 1.12 @@ -111,18 +111,23 @@ } } +/***************************************************************************************/ -/************************************************************************** - Runs a given function in a newly created thread under the given name which - in linked into a internal list. -**************************************************************************/ thread_t thread_add(char *thread_name, int (*entry)(void *), void *eudata) { - fprintf(stderr, "%s not implemented yet!\n", __PRETTY_FUNCTION__); - exit(1); + GThread *t; + if ((t = g_thread_create((GThreadFunc)entry,eudata,TRUE,NULL))) + { + g_mutex_lock(thread_mutex); + g_cond_wait(thread_cond,thread_mutex); + g_mutex_unlock(thread_mutex); + return (thread_t)t; + } return NULL; } +/***************************************************************************************/ + int thread_start(int (*entry)(void*), void *udata) { if (!input_added) @@ -141,12 +146,16 @@ return 0; } +/***************************************************************************************/ + void thread_abort(thread_t thread) { fprintf(stderr, "%s not implemented yet!\n", __PRETTY_FUNCTION__); exit(1); } +/***************************************************************************************/ + /* Call the function synchron, calls timer_callback on the calling process context */ int thread_call_parent_function_sync_timer_callback(void (*timer_callback)(void*), void *timer_data, int millis, void *function, int argcount, ...) { |
From: Sebastian B. <sb...@us...> - 2013-12-13 18:52:07
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12201 Modified Files: subthreads.c Log Message: Print error message for unsupported functions. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- subthreads.c 7 Dec 2013 20:19:07 -0000 1.10 +++ subthreads.c 13 Dec 2013 18:52:05 -0000 1.11 @@ -118,6 +118,8 @@ **************************************************************************/ thread_t thread_add(char *thread_name, int (*entry)(void *), void *eudata) { + fprintf(stderr, "%s not implemented yet!\n", __PRETTY_FUNCTION__); + exit(1); return NULL; } @@ -141,12 +143,15 @@ void thread_abort(thread_t thread) { + fprintf(stderr, "%s not implemented yet!\n", __PRETTY_FUNCTION__); + exit(1); } /* Call the function synchron, calls timer_callback on the calling process context */ int thread_call_parent_function_sync_timer_callback(void (*timer_callback)(void*), void *timer_data, int millis, void *function, int argcount, ...) { - return 0; + fprintf(stderr, "%s not implemented yet!\n", __PRETTY_FUNCTION__); + exit(1); } /************************************************************************** |
From: Sebastian B. <sb...@us...> - 2013-12-13 18:50:44
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12061 Modified Files: imap2_unittest.c Log Message: Attempt to connect to the imap server. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- imap2_unittest.c 12 Dec 2013 21:44:29 -0000 1.1 +++ imap2_unittest.c 13 Dec 2013 18:50:42 -0000 1.2 @@ -34,6 +34,7 @@ void test_imap(void) { struct account *ac; + struct folder *f; config_set_user_profile_directory("imap-profile"); @@ -66,6 +67,13 @@ folder_create_imap(); + f = folder_find_by_name("localhost"); + CU_ASSERT(f != NULL); + + imap_thread_connect(f); + + sleep(2); + del_folders(); free_config(); } |