diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-09-10 17:26:55 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-09-10 17:26:55 +0200 |
commit | a4dea80c2267f7fccbf62ae4ea3c45b0c7b2c90d (patch) | |
tree | 0d0d5d582f6b3a3fb56012d4849aa9daef6feeb4 /odb/details/win32/tls.txx | |
parent | 69848e3b70a078a5ba118f0a5ab08e1323954cb2 (diff) |
Add low-level once API that is static initialization-safe
Diffstat (limited to 'odb/details/win32/tls.txx')
-rw-r--r-- | odb/details/win32/tls.txx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/odb/details/win32/tls.txx b/odb/details/win32/tls.txx index 025e7cb..4290a35 100644 --- a/odb/details/win32/tls.txx +++ b/odb/details/win32/tls.txx @@ -16,7 +16,7 @@ namespace odb // tls<T> // template <typename T> - once tls<T>::once_; + win32_once_t tls<T>::once_= WIN32_ONCE_INIT; template <typename T> size_t tls<T>::key_; @@ -25,7 +25,7 @@ namespace odb T& tls<T>:: get () const { - once_.call (key_init); + win32_once (once_, key_init); if (void* v = _get (key_)) return *static_cast<T*> (v); @@ -42,7 +42,7 @@ namespace odb void tls<T>:: free () { - once_.call (key_init); + win32_once (once_, key_init); if (void* v = _get (key_)) { @@ -68,7 +68,7 @@ namespace odb // tls<T*> // template <typename T> - once tls<T*>::once_; + win32_once_t tls<T*>::once_ = WIN32_ONCE_INIT; template <typename T> size_t tls<T*>::key_; @@ -77,7 +77,7 @@ namespace odb T* tls<T*>:: get () const { - once_.call (key_init); + win32_once (once_, key_init); return static_cast<T*> (_get (key_)); } @@ -85,7 +85,7 @@ namespace odb void tls<T*>:: set (T* p) { - once_.call (key_init); + win32_once (once_, key_init); _set (key_, p); } |