Enlightenment CVS committal Author : glassy Project : e17 Module : apps/engycad
Dir : e17/apps/engycad/src Modified Files: guiserv.c panel.c serv.c shell.c Log Message: crash on dualcores fixed =================================================================== RCS file: /cvs/e/e17/apps/engycad/src/guiserv.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- guiserv.c 10 Jul 2007 15:16:10 -0000 1.2 +++ guiserv.c 13 Jul 2007 06:20:28 -0000 1.3 @@ -291,7 +291,7 @@ FREE(s); } if (!fl2) - cl_hint_set(o_cl, DUP(_("cmd: "))); + cl_hint_set(o_cl, _("cmd: ")); } } =================================================================== RCS file: /cvs/e/e17/apps/engycad/src/panel.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- panel.c 9 Jul 2007 17:19:54 -0000 1.3 +++ panel.c 13 Jul 2007 06:20:28 -0000 1.4 @@ -295,6 +295,7 @@ Evas_List *l; double w; int _x, _y; + char *s; Evas_Event_Mouse_In *em = (Evas_Event_Mouse_In*)event_info; e = shell->evas; @@ -317,7 +318,9 @@ evas_object_hide(oa); evas_object_show(oh); - evas_object_text_text_set(o_hte, my_iconv(shell->dcd, DUP(_(ic->hint)))); + s = my_iconv(shell->dcd, _(ic->hint)); + evas_object_text_text_set(o_hte, s); + FREE(s); w = evas_object_text_horiz_advance_get(o_hte); evas_object_move(o_hbg, _x + w * ((ic->x >= 0) ? 0 : -1), _y + 20 * ((ic->y >= 0) ? 1 : -1)); =================================================================== RCS file: /cvs/e/e17/apps/engycad/src/serv.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- serv.c 10 Jul 2007 15:16:10 -0000 1.3 +++ serv.c 13 Jul 2007 06:20:28 -0000 1.4 @@ -32,9 +32,8 @@ /* vars */ -pthread_mutex_t servmutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t datamutex = PTHREAD_MUTEX_INITIALIZER; -pthread_mutex_t quemutex = PTHREAD_MUTEX_INITIALIZER; + pthread_t thserv; char *ipc_script_name; char file[4096]; @@ -119,22 +118,17 @@ void serv_init(void) { - pthread_mutex_lock(&servmutex); + // pthread_mutex_lock(&servmutex); pthread_create(&thserv, NULL, (void *)serv_loop, NULL); }; void _serv_put_string(char *s) { - int need_to_unlock = 0; - if (!s) return; - if (!serv_queue) - need_to_unlock = 1; + serv_queue = evas_list_append(serv_queue, s); - if (need_to_unlock) - pthread_mutex_unlock(&servmutex); } void @@ -148,7 +142,7 @@ if (strlen(s) > 4000) s[4000] = 0; - pthread_mutex_lock(&quemutex); + pthread_mutex_lock(&datamutex); for (i = 0, j = 0; s[i]; i++) { if ((s[i] == '|') || (j == 4095)) @@ -166,22 +160,29 @@ buf[j] = 0; _serv_put_string(DUP(_(buf))); FREE(s); - pthread_mutex_unlock(&quemutex); + pthread_mutex_unlock(&datamutex); } char * _serv_get_string(void) { - char *s; + char *s = NULL; + + do + { + pthread_mutex_lock(&datamutex); + if(!serv_queue) + { + pthread_mutex_unlock(&datamutex); + usleep(10*1000); + continue; + } + s = serv_queue->data; + serv_queue = evas_list_remove(serv_queue, s); + pthread_mutex_unlock(&datamutex); + } + while(!s); - pthread_mutex_lock(&servmutex); - pthread_mutex_lock(&quemutex); - ENGY_ASSERTS(serv_queue, "am i an idiot?"); - s = serv_queue->data; /* fifo */ - serv_queue = evas_list_remove(serv_queue, s); - pthread_mutex_unlock(&quemutex); - if (serv_queue) - pthread_mutex_unlock(&servmutex); return s; } @@ -223,8 +224,9 @@ serv_parser(s); } - printf("I quit!!!\n"); + pthread_mutex_destroy(&datamutex); fl_shutdown = 2; + } #define IFCMD(a) if(!strcmp(_(s),_(a)))set_flag(); if(!strcmp(_(s),_(a))) @@ -309,6 +311,10 @@ IFCMD("save_ps") serv_save_ps(); IFCMD("help") serv_help(); IFCMD("__exit") fl_shutdown = 1; + { + static long death_count = 0; + IFCMD("dummy") printf("%d\n", death_count++); + } FREE(s); } =================================================================== RCS file: /cvs/e/e17/apps/engycad/src/shell.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- shell.c 10 Jul 2007 15:16:10 -0000 1.4 +++ shell.c 13 Jul 2007 06:20:28 -0000 1.5 @@ -405,6 +405,8 @@ shell_init(); ecore_main_loop_begin(); shell_shutdown(); + ecore_evas_free(shell->ee); + ecore_evas_shutdown(); return 0; } ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs