pthread to win32

This commit is contained in:
caiosignor 2020-03-13 15:03:07 -03:00 committed by João Paulo Taylor Ienczak Zanette
parent f9b57e5569
commit cb61d63cb8
2 changed files with 13 additions and 7 deletions

View File

@ -297,7 +297,8 @@ eina_init(void)
#endif
#ifdef EFL_HAVE_THREADS
_eina_main_loop = pthread_self();
//_eina_main_loop = pthread_self();
_eina_main_loop = eina_thread_self();
#endif
eina_freeq_main_set(eina_freeq_new(EINA_FREEQ_DEFAULT));
@ -390,7 +391,8 @@ eina_threads_init(void)
int ret;
#ifdef EINA_HAVE_DEBUG_THREADS
assert(pthread_equal(_eina_main_loop, pthread_self()));
//assert(pthread_equal(_eina_main_loop, pthread_self()));
assert(eina_thread_equal(_eina_main_loop, eina_thread_self()));
#endif
++_eina_main_thread_count;
@ -416,7 +418,8 @@ eina_threads_shutdown(void)
int ret;
#ifdef EINA_HAVE_DEBUG_THREADS
assert(pthread_equal(_eina_main_loop, pthread_self()));
//assert(pthread_equal(_eina_main_loop, pthread_self()));
assert(eina_thread_equal(_eina_main_loop, eina_thread_self()));
assert(_eina_main_thread_count > 0);
#endif
@ -440,10 +443,12 @@ eina_main_loop_is(void)
# ifdef __GNUC__
/* pthread_self() can't be optimized, it's a single asm "movl" */
if (__builtin_types_compatible_p(pthread_t, unsigned long int))
return (pthread_self() == _eina_main_loop);
//return (pthread_self() == _eina_main_loop);
return (eina_thread_self() == _eina_main_loop);
else
# endif
if (pthread_equal(_eina_main_loop, pthread_self()))
//if (pthread_equal(_eina_main_loop, pthread_self()))
if (eina_thread_equal(_eina_main_loop, eina_thread_self()))
return EINA_TRUE;
#endif
return EINA_FALSE;
@ -454,7 +459,8 @@ EAPI void
eina_main_loop_define(void)
{
#ifdef EFL_HAVE_THREADS
_eina_main_loop = pthread_self();
//_eina_main_loop = pthread_self();
_eina_main_loop = eina_thread_self();
#endif
}

View File

@ -31,7 +31,7 @@
#include "eina_sched.h"
#include "eina_log.h"
#define RTNICENESS 1
#define RTNICENESS 1s
#define NICENESS 5
EAPI void