raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4478654be185718ade7482df55c8643d3224fb37

commit 4478654be185718ade7482df55c8643d3224fb37
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Wed Sep 7 20:52:50 2016 +0900

    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.
---
 src/lib/eo/Eo.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 1e35348..57e9af7 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)))  
 \

-- 


Reply via email to