mirror of
https://github.com/boostorg/regex.git
synced 2025-07-17 14:22:08 +02:00
Fix generic mutex usage, see https://svn.boost.org/trac/boost/ticket/9461.
This commit is contained in:
@ -25,6 +25,7 @@ this gets bumped up from v4 to v5.
|
|||||||
* Fixed documentation typos from [@https://svn.boost.org/trac/boost/ticket/9283 #9283].
|
* Fixed documentation typos from [@https://svn.boost.org/trac/boost/ticket/9283 #9283].
|
||||||
* Fixed bug in collation code that failed if the locale generated collation strings with embedded nul's,
|
* Fixed bug in collation code that failed if the locale generated collation strings with embedded nul's,
|
||||||
see [@https://svn.boost.org/trac/boost/ticket/9451 #9451].
|
see [@https://svn.boost.org/trac/boost/ticket/9451 #9451].
|
||||||
|
* Apply patch for unusual thread usage (no statically initiallized mutexes), see [@https://svn.boost.org/trac/boost/ticket/9461 #9461].
|
||||||
|
|
||||||
[h4 Boost-1.54]
|
[h4 Boost-1.54]
|
||||||
|
|
||||||
|
@ -125,12 +125,15 @@ private:
|
|||||||
// Since this preprocessor path is almost never taken, we hide these header
|
// Since this preprocessor path is almost never taken, we hide these header
|
||||||
// dependencies so that build tools don't find them.
|
// dependencies so that build tools don't find them.
|
||||||
//
|
//
|
||||||
#define B1 <boost/thread/once.hpp>
|
#define BOOST_REGEX_H1 <boost/thread/once.hpp>
|
||||||
#define B2 <boost/thread/recursive_mutex.hpp>
|
#define BOOST_REGEX_H2 <boost/thread/recursive_mutex.hpp>
|
||||||
#include B1
|
#define BOOST_REGEX_H3 <boost/thread/lock_types.hpp>
|
||||||
#include B2
|
#include BOOST_REGEX_H1
|
||||||
#undef B1
|
#include BOOST_REGEX_H2
|
||||||
#undef B2
|
#include BOOST_REGEX_H3
|
||||||
|
#undef BOOST_REGEX_H1
|
||||||
|
#undef BOOST_REGEX_H2
|
||||||
|
#undef BOOST_REGEX_H3
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
|
||||||
@ -158,7 +161,7 @@ public:
|
|||||||
void lock();
|
void lock();
|
||||||
void unlock();
|
void unlock();
|
||||||
private:
|
private:
|
||||||
boost::recursive_mutex::scoped_lock* m_plock;
|
boost::unique_lock<boost::recursive_mutex>* m_plock;
|
||||||
bool m_have_lock;
|
bool m_have_lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ void scoped_static_mutex_lock::lock()
|
|||||||
{
|
{
|
||||||
boost::call_once(static_mutex::m_once,&static_mutex::init);
|
boost::call_once(static_mutex::m_once,&static_mutex::init);
|
||||||
if(0 == m_plock)
|
if(0 == m_plock)
|
||||||
m_plock = new boost::recursive_mutex::scoped_lock(*static_mutex::m_pmutex, boost::defer_lock);
|
m_plock = new boost::unique_lock<boost::recursive_mutex>(*static_mutex::m_pmutex, boost::defer_lock);
|
||||||
m_plock->lock();
|
m_plock->lock();
|
||||||
m_have_lock = true;
|
m_have_lock = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user