1 // synchronizaion.hpp --------------------------------------------------------------//
3 // Copyright 2010 Vicente J. Botet Escriba
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
9 #ifndef BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
10 #define BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
12 #include <boost/detail/win/basic_types.hpp>
21 #if defined( BOOST_USE_WINDOWS_H )
22 typedef ::CRITICAL_SECTION CRITICAL_SECTION_;
23 typedef ::PAPCFUNC PAPCFUNC_;
25 using ::InitializeCriticalSection;
26 using ::EnterCriticalSection;
27 using ::TryEnterCriticalSection;
28 using ::LeaveCriticalSection;
29 using ::DeleteCriticalSection;
31 # ifdef BOOST_NO_ANSI_APIS
35 using ::CreateSemaphoreW;
40 using ::CreateSemaphoreA;
43 using ::ReleaseSemaphore;
46 using ::WaitForMultipleObjects;
47 using ::WaitForSingleObject;
51 struct CRITICAL_SECTION_
53 struct critical_section_debug * DebugInfo;
59 unsigned __int64 SpinCount;
61 unsigned long SpinCount;
65 __declspec(dllimport) void __stdcall
66 InitializeCriticalSection(CRITICAL_SECTION_ *);
67 __declspec(dllimport) void __stdcall
68 EnterCriticalSection(CRITICAL_SECTION_ *);
69 __declspec(dllimport) bool __stdcall
70 TryEnterCriticalSection(CRITICAL_SECTION_ *);
71 __declspec(dllimport) void __stdcall
72 LeaveCriticalSection(CRITICAL_SECTION_ *);
73 __declspec(dllimport) void __stdcall
74 DeleteCriticalSection(CRITICAL_SECTION_ *);
76 struct _SECURITY_ATTRIBUTES;
77 # ifdef BOOST_NO_ANSI_APIS
78 __declspec(dllimport) void* __stdcall
79 CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*);
80 __declspec(dllimport) void* __stdcall
81 CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*);
82 __declspec(dllimport) void* __stdcall
83 CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*);
84 __declspec(dllimport) void* __stdcall
85 OpenEventW(unsigned long,int,wchar_t const*);
87 __declspec(dllimport) void* __stdcall
88 CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*);
89 __declspec(dllimport) void* __stdcall
90 CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*);
91 __declspec(dllimport) void* __stdcall
92 CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*);
93 __declspec(dllimport) void* __stdcall
94 OpenEventA(unsigned long,int,char const*);
96 __declspec(dllimport) int __stdcall
98 __declspec(dllimport) unsigned long __stdcall
99 WaitForSingleObject(void*,unsigned long);
100 __declspec(dllimport) unsigned long __stdcall
101 WaitForMultipleObjects(unsigned long nCount,
102 void* const * lpHandles,
104 unsigned long dwMilliseconds);
105 __declspec(dllimport) int __stdcall
106 ReleaseSemaphore(void*,long,long*);
107 typedef void (__stdcall *PAPCFUNC8)(ulong_ptr);
108 __declspec(dllimport) unsigned long __stdcall
109 QueueUserAPC(PAPCFUNC8,void*,ulong_ptr);
111 __declspec(dllimport) int __stdcall
113 __declspec(dllimport) int __stdcall
125 #endif // BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP