aboutsummaryrefslogtreecommitdiff
path: root/odb/details/win32/once.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-03 16:20:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-03 16:20:38 +0200
commit0e2ae18a97fd507bac872031888d34c3a7d8b17b (patch)
tree3f9a551486969d2bc05f272e2da372c1a55d34cf /odb/details/win32/once.cxx
parent137b1eb3e41578d9d4a066ef75c6abfa597c46cd (diff)
Implement Win32 TLS support
Diffstat (limited to 'odb/details/win32/once.cxx')
-rw-r--r--odb/details/win32/once.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/odb/details/win32/once.cxx b/odb/details/win32/once.cxx
new file mode 100644
index 0000000..9201ea6
--- /dev/null
+++ b/odb/details/win32/once.cxx
@@ -0,0 +1,29 @@
+// file : odb/details/win32/once.cxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#include <windows.h>
+
+#include <odb/details/win32/once.hxx>
+#include <odb/details/win32/once-init.hxx>
+
+namespace odb
+{
+ namespace details
+ {
+ CRITICAL_SECTION once::cs_;
+
+ void
+ once_process_start ()
+ {
+ InitializeCriticalSection (&once::cs_);
+ }
+
+ void
+ once_process_end (bool)
+ {
+ DeleteCriticalSection (&once::cs_);
+ }
+ }
+}