mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
use regular new rather than replacement new in mongo::mutex
This commit is contained in:
parent
e339760675
commit
19e879c509
@ -287,10 +287,10 @@ namespace mongo {
|
|||||||
// destroying them.
|
// destroying them.
|
||||||
class mutex : boost::noncopyable {
|
class mutex : boost::noncopyable {
|
||||||
public:
|
public:
|
||||||
mutex() { new (_buf) boost::mutex(); }
|
mutex() { _m = new boost::mutex(); }
|
||||||
~mutex() {
|
~mutex() {
|
||||||
if( !__destroyingStatics ) {
|
if( !__destroyingStatics ) {
|
||||||
boost().boost::mutex::~mutex();
|
delete _m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class scoped_lock : boost::noncopyable {
|
class scoped_lock : boost::noncopyable {
|
||||||
@ -301,8 +301,8 @@ namespace mongo {
|
|||||||
boost::mutex::scoped_lock _l;
|
boost::mutex::scoped_lock _l;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
boost::mutex &boost() { return *( boost::mutex * )( _buf ); }
|
boost::mutex &boost() { return *_m; }
|
||||||
char _buf[ sizeof( boost::mutex ) ];
|
boost::mutex *_m;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef mongo::mutex::scoped_lock scoped_lock;
|
typedef mongo::mutex::scoped_lock scoped_lock;
|
||||||
|
Loading…
Reference in New Issue
Block a user