forked from enlightenment/efl
parent
b3469dd413
commit
2b574523d2
|
@ -118,3 +118,8 @@
|
|||
2011-07-04 Carsten Haitzler (The Rasterman)
|
||||
|
||||
* Add eina_mmap safety handling.
|
||||
|
||||
2011-07-29 Cedric Bail
|
||||
|
||||
* Add eina_main_loop_is.
|
||||
|
||||
|
|
|
@ -132,6 +132,15 @@ EAPI int eina_threads_init(void);
|
|||
*/
|
||||
EAPI int eina_threads_shutdown(void);
|
||||
|
||||
/**
|
||||
* @brief Check if you are calling this function from the same thread Eina was initialized or not
|
||||
*
|
||||
* Most EFL function are not thread safe and all the call need to happen in
|
||||
* the main loop. With this call you could know if you can call an EFL
|
||||
* function or not.
|
||||
*/
|
||||
EAPI Eina_Bool eina_main_loop_is(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -316,6 +316,19 @@ eina_threads_shutdown(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
eina_main_loop_is(void)
|
||||
{
|
||||
#ifdef EINA_HAVE_DEBUG_THREADS
|
||||
if (pthread_equal(_eina_main_loop, pthread_self()))
|
||||
return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
#else
|
||||
/* FIXME: need to check how to do this on windows */
|
||||
return EINA_TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue