29 #ifndef RCF_DETAIL_WIN_MUTEX_HPP
30 #define RCF_DETAIL_WIN_MUTEX_HPP
32 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
34 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
36 #if defined(BOOST_WINDOWS)
38 #include <RCF/thread/scoped_lock.hpp>
40 #include <RCF/thread/push_options.hpp>
45 class RCF_EXPORT win_mutex
49 typedef RCF::detail::scoped_lock<win_mutex> scoped_lock;
53 win_mutex(
bool allowRecursiveLocking);
58 ::DeleteCriticalSection(&crit_section_);
66 int threadId = GetCurrentThreadId();
67 if (!mAllowRecursiveLocking)
69 assert(threadId != mThreadId &&
"Recursive locking detected.");
73 ::EnterCriticalSection(&crit_section_);
88 ::LeaveCriticalSection(&crit_section_);
93 void commonCtor(
bool allowRecursiveLocking);
100 ::CRITICAL_SECTION crit_section_;
105 bool mAllowRecursiveLocking;
114 #include <RCF/thread/pop_options.hpp>
116 #endif // defined(BOOST_WINDOWS)
118 #endif // RCF_DETAIL_WIN_MUTEX_HPP