Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_thumb.c Log Message: shutdown thumbs properly delat killing slave thumbnailers for 1 second after all thumbs pending are finished (in case more get added soon) =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_thumb.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -3 -r1.31 -r1.32 --- e_thumb.c 8 Jul 2006 13:30:18 -0000 1.31 +++ e_thumb.c 8 Jul 2006 13:53:55 -0000 1.32 @@ -23,6 +23,8 @@ static void _e_thumb_hash_del(int objid); static Evas_Object *_e_thumb_hash_find(int objid); static void _e_thumb_thumbnailers_kill(void); +static void _e_thumb_thumbnailers_kill_cancel(void); +static int _e_thumb_cb_kill(void *data); static int _e_thumb_cb_exe_event_del(void *data, int type, void *event); /* local subsystem globals */ @@ -34,6 +36,7 @@ static int _pending = 0; static int _num_thumbnailers = 2; static Ecore_Event_Handler *_exe_del_handler = NULL; +static Ecore_Timer *_kill_timer = NULL; /* externally accessible functions */ EAPI int @@ -48,8 +51,21 @@ EAPI int e_thumb_shutdown(void) { + _e_thumb_thumbnailers_kill_cancel(); + _e_thumb_cb_kill(NULL); ecore_event_handler_del(_exe_del_handler); _exe_del_handler = NULL; + _thumbnailers = evas_list_free(_thumbnailers); + while (_thumbnailers_exe) + { + ecore_exe_free(_thumbnailers_exe->data); + _thumbnailers_exe = evas_list_remove_list(_thumbnailers_exe, _thumbnailers_exe); + } + _thumb_queue = evas_list_free(_thumb_queue); + _objid = 0; + evas_hash_free(_thumbs); + _thumbs = NULL; + _pending = 0; return 1; } @@ -128,10 +144,12 @@ eth2->queued = 0; eth2->busy = 1; _pending++; + if (_pending == 1) _e_thumb_thumbnailers_kill_cancel(); _e_thumb_gen_begin(eth2->objid, eth2->file, eth2->key, eth2->w, eth2->h); } eth->busy = 1; _pending++; + if (_pending == 1) _e_thumb_thumbnailers_kill_cancel(); _e_thumb_gen_begin(eth->objid, eth->file, eth->key, eth->w, eth->h); } @@ -195,6 +213,7 @@ eth->queued = 0; eth->busy = 1; _pending++; + if (_pending == 1) _e_thumb_thumbnailers_kill_cancel(); _e_thumb_gen_begin(eth->objid, eth->file, eth->key, eth->w, eth->h); } } @@ -297,10 +316,26 @@ static void _e_thumb_thumbnailers_kill(void) { + if (_kill_timer) ecore_timer_del(_kill_timer); + _kill_timer = ecore_timer_add(1.0, _e_thumb_cb_kill, NULL); +} + +static void +_e_thumb_thumbnailers_kill_cancel(void) +{ + if (_kill_timer) ecore_timer_del(_kill_timer); + _kill_timer = NULL; +} + +static int +_e_thumb_cb_kill(void *data) +{ Evas_List *l; for (l = _thumbnailers_exe; l; l = l->next) ecore_exe_terminate(l->data); + _kill_timer = NULL; + return 0; } static int Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs