On Fri, 29 Jul 2011, Enlightenment SVN wrote:
> Log: > eina: add eina_main_loop_is. > > > Author: cedric > Date: 2011-07-29 07:56:42 -0700 (Fri, 29 Jul 2011) > New Revision: 61896 > Trac: http://trac.enlightenment.org/e/changeset/61896 > > Modified: > trunk/eina/ChangeLog trunk/eina/src/include/eina_main.h > trunk/eina/src/lib/eina_main.c > > Modified: trunk/eina/ChangeLog > =================================================================== > --- trunk/eina/ChangeLog 2011-07-29 14:41:18 UTC (rev 61895) > +++ trunk/eina/ChangeLog 2011-07-29 14:56:42 UTC (rev 61896) > @@ -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. > + > > Modified: trunk/eina/src/include/eina_main.h > =================================================================== > --- trunk/eina/src/include/eina_main.h 2011-07-29 14:41:18 UTC (rev > 61895) > +++ trunk/eina/src/include/eina_main.h 2011-07-29 14:56:42 UTC (rev > 61896) > @@ -133,6 +133,15 @@ > 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); > + > +/** > * @} > */ > > > Modified: trunk/eina/src/lib/eina_main.c > =================================================================== > --- trunk/eina/src/lib/eina_main.c 2011-07-29 14:41:18 UTC (rev 61895) > +++ trunk/eina/src/lib/eina_main.c 2011-07-29 14:56:42 UTC (rev 61896) > @@ -316,6 +316,19 @@ > #endif > } > > +EAPI Eina_Bool > +eina_main_loop_is(void) > +{ First you have to check here if threads are enabled Vincent > +#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 > +} > + > /** > * @} > */ > > > ------------------------------------------------------------------------------ > Got Input? Slashdot Needs You. > Take our quick survey online. Come on, we don't ask for help often. > Plus, you'll get a chance to win $100 to spend on ThinkGeek. > http://p.sf.net/sfu/slashdot-survey > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > > ------------------------------------------------------------------------------ Got Input? Slashdot Needs You. Take our quick survey online. Come on, we don't ask for help often. Plus, you'll get a chance to win $100 to spend on ThinkGeek. http://p.sf.net/sfu/slashdot-survey _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel