forked from enlightenment/efl
eo resolv call cache - make TLS with __thread, linker+compiler do it
this will now fix the call cache to be a tls data member and thus threadsafe. this is the sanest way.
This commit is contained in:
parent
09f19c3c73
commit
4478654be1
|
@ -760,9 +760,15 @@ typedef struct _Efl_Object_Call_Cache
|
||||||
# define EFL_FUNC_COMMON_OP_FUNC(Name) ((const void *) #Name)
|
# define EFL_FUNC_COMMON_OP_FUNC(Name) ((const void *) #Name)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
# define EFL_FUNC_TLS __declspec(thread)
|
||||||
|
#else
|
||||||
|
# define EFL_FUNC_TLS __thread
|
||||||
|
#endif
|
||||||
|
|
||||||
// cache OP id, get real fct and object data then do the call
|
// cache OP id, get real fct and object data then do the call
|
||||||
#define EFL_FUNC_COMMON_OP(Obj, Name, DefRet) \
|
#define EFL_FUNC_COMMON_OP(Obj, Name, DefRet) \
|
||||||
static Efl_Object_Call_Cache ___cache; /* static 0 by default */ \
|
static EFL_FUNC_TLS Efl_Object_Call_Cache ___cache; /* static 0 by default */ \
|
||||||
Efl_Object_Op_Call_Data ___call; \
|
Efl_Object_Op_Call_Data ___call; \
|
||||||
if (EINA_UNLIKELY((___cache.op == EFL_NOOP) || \
|
if (EINA_UNLIKELY((___cache.op == EFL_NOOP) || \
|
||||||
(___cache.generation != _efl_object_init_generation))) \
|
(___cache.generation != _efl_object_init_generation))) \
|
||||||
|
|
Loading…
Reference in New Issue