From e95406e8b97dc48901c44283d7584b4e2e632229 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Fri, 19 Mar 2010 23:57:50 +0000 Subject: [PATCH] WinCE doesn't provide InitializeCriticalSectionAndSpinCount. [SVN r60722] --- include/boost/asio/detail/win_mutex.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/boost/asio/detail/win_mutex.hpp b/include/boost/asio/detail/win_mutex.hpp index ff71fbeb..176a5fd9 100644 --- a/include/boost/asio/detail/win_mutex.hpp +++ b/include/boost/asio/detail/win_mutex.hpp @@ -84,12 +84,20 @@ private: #if defined(__MINGW32__) // Not sure if MinGW supports structured exception handling, so for now // we'll just call the Windows API and hope. +# if defined(UNDER_CE) + ::InitializeCriticalSection(&crit_section_); +# else ::InitializeCriticalSectionAndSpinCount(&crit_section_, 0x80000000); +# endif return 0; #else __try { +# if defined(UNDER_CE) + ::InitializeCriticalSection(&crit_section_); +# else ::InitializeCriticalSectionAndSpinCount(&crit_section_, 0x80000000); +# endif } __except(GetExceptionCode() == STATUS_NO_MEMORY ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)