aboutsummaryrefslogtreecommitdiff
path: root/odb/details/tls.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/details/tls.hxx')
-rw-r--r--odb/details/tls.hxx28
1 files changed, 27 insertions, 1 deletions
diff --git a/odb/details/tls.hxx b/odb/details/tls.hxx
index 2ed68ab..2c19081 100644
--- a/odb/details/tls.hxx
+++ b/odb/details/tls.hxx
@@ -54,7 +54,33 @@ namespace odb
#elif defined(ODB_THREADS_POSIX)
# include <odb/details/posix/tls.hxx>
-# define ODB_TLS_POINTER(type) tls<type*>
+
+# ifdef ODB_THREADS_TLS_KEYWORD
+# define ODB_TLS_POINTER(type) __thread type*
+
+namespace odb
+{
+ namespace details
+ {
+ template <typename T>
+ inline T*
+ tls_get (T* p)
+ {
+ return p;
+ }
+
+ template <typename T>
+ inline void
+ tls_set (T*& rp, T* p)
+ {
+ rp = p;
+ }
+ }
+}
+
+# else
+# define ODB_TLS_POINTER(type) tls<type*>
+# endif
# define ODB_TLS_OBJECT(type) tls<type>
#elif defined(ODB_THREADS_WIN32)