diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-09-07 20:52:50 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-09-07 20:58:39 +0900 |
commit | 4478654be185718ade7482df55c8643d3224fb37 (patch) | |
tree | d19e329b2a9d8bc5959f74e85df112f4a0ba6dee | |
parent | 09f19c3c73b73eeee4201bb462bad9f2b5276409 (diff) | |
download | efl-4478654be185718ade7482df55c8643d3224fb37.tar.gz |
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.
-rw-r--r-- | src/lib/eo/Eo.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index 1e353486a4..57e9af7fae 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -760,9 +760,15 @@ typedef struct _Efl_Object_Call_Cache # define EFL_FUNC_COMMON_OP_FUNC(Name) ((const void *) #Name) #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 #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; \ if (EINA_UNLIKELY((___cache.op == EFL_NOOP) || \ (___cache.generation != _efl_object_init_generation))) \ |