2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-11 12:12:12 +00:00

Merge fixes from main branch.

[SVN r22321]
This commit is contained in:
Michael Glassford
2004-02-19 01:10:56 +00:00
parent 17f72cf580
commit 3259f681a4
4 changed files with 14 additions and 12 deletions

View File

@@ -23,17 +23,23 @@
#elif defined(BOOST_HAS_PTHREADS)
# include <errno.h>
#elif defined(BOOST_HAS_MPTASKS)
# include <MacErrors.h>
# include "safe.hpp"
# include <MacErrors.h>
# include "safe.hpp"
#endif
namespace boost {
#if defined(BOOST_HAS_WINTHREADS)
recursive_mutex::recursive_mutex()
: m_count(0)
: m_mutex(0), m_count(0)
{
m_mutex = reinterpret_cast<void*>(new(std::nothrow) CRITICAL_SECTION);
try
{
m_mutex = reinterpret_cast<void*>(new CRITICAL_SECTION);
}
catch (...)
{
}
if (!m_mutex)
throw thread_resource_error();
InitializeCriticalSection(reinterpret_cast<LPCRITICAL_SECTION>(m_mutex));