summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_main.c
diff options
context:
space:
mode:
authorMike McCormack <mj.mccormack@samsung.com>2011-07-05 11:13:29 +0000
committerMike McCormack <mikem@ring3k.org>2011-07-05 11:13:29 +0000
commit7b1d7bd4a01e7d63d20e4fc3331a939c58af7135 (patch)
tree1fb82d2d38ef18f619a9d7a79440c6498c885368 /legacy/ecore/src/lib/ecore/ecore_main.c
parentf7ec79e13efacbcd32d54513877ffd3c5766442d (diff)
ecore: Add basic thread checks
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com> SVN revision: 61041
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_main.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_main.c b/legacy/ecore/src/lib/ecore/ecore_main.c
index a8ee1742ac..e739398663 100644
--- a/legacy/ecore/src/lib/ecore/ecore_main.c
+++ b/legacy/ecore/src/lib/ecore/ecore_main.c
@@ -674,10 +674,11 @@ _ecore_main_loop_shutdown(void)
674EAPI void 674EAPI void
675ecore_main_loop_iterate(void) 675ecore_main_loop_iterate(void)
676{ 676{
677 ECORE_MAIN_LOOP_ASSERT();
677#ifndef USE_G_MAIN_LOOP 678#ifndef USE_G_MAIN_LOOP
678 _ecore_main_loop_iterate_internal(1); 679 _ecore_main_loop_iterate_internal(1);
679#else 680#else
680 g_main_context_iteration(NULL, 1); 681 g_main_context_iteration(NULL, 1);
681#endif 682#endif
682} 683}
683 684
@@ -702,6 +703,7 @@ ecore_main_loop_iterate(void)
702EAPI void 703EAPI void
703ecore_main_loop_begin(void) 704ecore_main_loop_begin(void)
704{ 705{
706 ECORE_MAIN_LOOP_ASSERT();
705#ifndef USE_G_MAIN_LOOP 707#ifndef USE_G_MAIN_LOOP
706 in_main_loop++; 708 in_main_loop++;
707 while (do_quit == 0) _ecore_main_loop_iterate_internal(0); 709 while (do_quit == 0) _ecore_main_loop_iterate_internal(0);
@@ -820,6 +822,8 @@ ecore_main_fd_handler_add(int fd, Ecore_Fd_Handler_Flags flags, Ecore_Fd_Cb func
820{ 822{
821 Ecore_Fd_Handler *fdh; 823 Ecore_Fd_Handler *fdh;
822 824
825 ECORE_MAIN_LOOP_ASSERT();
826
823 if ((fd < 0) || (flags == 0) || (!func)) return NULL; 827 if ((fd < 0) || (flags == 0) || (!func)) return NULL;
824 828
825 fdh = calloc(1, sizeof(Ecore_Fd_Handler)); 829 fdh = calloc(1, sizeof(Ecore_Fd_Handler));
@@ -895,6 +899,8 @@ ecore_main_win32_handler_add(void *h __UNUSED__, Ecore_Win32_Handle_Cb func __UN
895EAPI void * 899EAPI void *
896ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler) 900ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler)
897{ 901{
902 ECORE_MAIN_LOOP_ASSERT();
903
898 if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER)) 904 if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER))
899 { 905 {
900 ECORE_MAGIC_FAIL(fd_handler, ECORE_MAGIC_FD_HANDLER, 906 ECORE_MAGIC_FAIL(fd_handler, ECORE_MAGIC_FD_HANDLER,
@@ -960,6 +966,8 @@ ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler __UNUSED__)
960EAPI void 966EAPI void
961ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Prep_Cb func, const void *data) 967ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Prep_Cb func, const void *data)
962{ 968{
969 ECORE_MAIN_LOOP_ASSERT();
970
963 if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER)) 971 if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER))
964 { 972 {
965 ECORE_MAGIC_FAIL(fd_handler, ECORE_MAGIC_FD_HANDLER, 973 ECORE_MAGIC_FAIL(fd_handler, ECORE_MAGIC_FD_HANDLER,
@@ -1006,6 +1014,8 @@ ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_
1006{ 1014{
1007 int ret = EINA_FALSE; 1015 int ret = EINA_FALSE;
1008 1016
1017 ECORE_MAIN_LOOP_ASSERT();
1018
1009 if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER)) 1019 if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER))
1010 { 1020 {
1011 ECORE_MAGIC_FAIL(fd_handler, ECORE_MAGIC_FD_HANDLER, 1021 ECORE_MAGIC_FAIL(fd_handler, ECORE_MAGIC_FD_HANDLER,
@@ -1029,6 +1039,8 @@ ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_
1029{ 1039{
1030 int ret; 1040 int ret;
1031 1041
1042 ECORE_MAIN_LOOP_ASSERT();
1043
1032 if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER)) 1044 if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER))
1033 { 1045 {
1034 ECORE_MAGIC_FAIL(fd_handler, ECORE_MAGIC_FD_HANDLER, 1046 ECORE_MAGIC_FAIL(fd_handler, ECORE_MAGIC_FD_HANDLER,