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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user