summaryrefslogtreecommitdiff
path: root/boost/asio/detail/impl/win_mutex.ipp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/asio/detail/impl/win_mutex.ipp')
-rw-r--r--boost/asio/detail/impl/win_mutex.ipp7
1 files changed, 4 insertions, 3 deletions
diff --git a/boost/asio/detail/impl/win_mutex.ipp b/boost/asio/detail/impl/win_mutex.ipp
index 6946fd1402..c4be08c5e9 100644
--- a/boost/asio/detail/impl/win_mutex.ipp
+++ b/boost/asio/detail/impl/win_mutex.ipp
@@ -2,7 +2,7 @@
// detail/impl/win_mutex.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -45,7 +45,8 @@ int win_mutex::do_init()
# if defined(UNDER_CE)
::InitializeCriticalSection(&crit_section_);
# elif defined(BOOST_ASIO_WINDOWS_APP)
- ::InitializeCriticalSectionEx(&crit_section_, 0x80000000, 0);
+ if (!::InitializeCriticalSectionEx(&crit_section_, 0, 0))
+ return ::GetLastError();
# else
if (!::InitializeCriticalSectionAndSpinCount(&crit_section_, 0x80000000))
return ::GetLastError();
@@ -58,7 +59,7 @@ int win_mutex::do_init()
::InitializeCriticalSection(&crit_section_);
# elif defined(BOOST_ASIO_WINDOWS_APP)
if (!::InitializeCriticalSectionEx(&crit_section_, 0, 0))
- return ::GetLastError();
+ return ::GetLastError();
# else
if (!::InitializeCriticalSectionAndSpinCount(&crit_section_, 0x80000000))
return ::GetLastError();