aboutsummaryrefslogtreecommitdiff
path: root/odb/details/win32/once.cxx
diff options
context:
space:
mode:
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_);
+ }
+ }
+}