more thread example fixes

this should cover fixes for T956
This commit is contained in:
Carsten Haitzler 2014-02-17 17:08:18 +09:00
parent a93ca4497d
commit 4053da6f6f
3 changed files with 19 additions and 9 deletions

View File

@ -45,16 +45,21 @@ my_thread_new(void)
perror("pthread_create");
}
// on window delete - cancel thread then delete window and exit mainloop
static void
del(void *data, Evas_Object *obj, void *event_info)
{
exit(0);
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *o;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("efl-thread-1", "EFL Thread 1");
elm_win_autodel_set(win, EINA_TRUE);
evas_object_smart_callback_add(win, "delete,request", del, NULL);
o = evas_object_rectangle_add(evas_object_evas_get(win));
evas_object_color_set(o, 50, 80, 180, 255);
evas_object_resize(o, 100, 100);
@ -68,7 +73,6 @@ elm_main(int argc, char **argv)
evas_object_show(win);
elm_run();
elm_shutdown();
return 0;
}

View File

@ -61,15 +61,21 @@ my_thread_mainloop_code(void *data)
return NULL;
}
// on window delete - cancel thread then delete window and exit mainloop
static void
del(void *data, Evas_Object *obj, void *event_info)
{
exit(0);
}
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *o;
win = elm_win_util_standard_add("efl-thread-2", "EFL Thread 2");
elm_win_autodel_set(win, EINA_TRUE);
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
evas_object_smart_callback_add(win, "delete,request", del, NULL);
o = evas_object_rectangle_add(evas_object_evas_get(win));
evas_object_color_set(o, 50, 80, 180, 255);
evas_object_resize(o, 100, 100);
@ -83,7 +89,6 @@ elm_main(int argc, char **argv)
evas_object_show(win);
elm_run();
elm_shutdown();
return 0;
}

View File

@ -63,6 +63,7 @@ my_thread_mainloop_code(void *data)
free(inf);
}
// on window delete - cancel thread then delete window and exit mainloop
static void
del(void *data, Evas_Object *obj, void *event_info)
{