mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 17:10:48 +01:00
SERVER-19029 Configure boost thread more efficiently
This commit is contained in:
parent
9bb8d65d8d
commit
9a86ae5e96
14
SConstruct
14
SConstruct
@ -2068,6 +2068,20 @@ def doConfigure(myenv):
|
||||
boostlib,
|
||||
[boostlib + suffix for suffix in boostSuffixList],
|
||||
language='C++')
|
||||
else:
|
||||
# For the built in boost, we can set these without risking ODR violations, so do so.
|
||||
conf.env.Append(
|
||||
CPPDEFINES=[
|
||||
# We don't want interruptions because we don't use
|
||||
# them and they have a performance cost.
|
||||
"BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS",
|
||||
|
||||
# We believe that none of our platforms are affected
|
||||
# by the EINTR bug. Setting this avoids a retry loop
|
||||
# in boosts mutex.hpp that we don't want to pay for.
|
||||
"BOOST_THREAD_HAS_NO_EINTR_BUG",
|
||||
],
|
||||
)
|
||||
|
||||
if posix_system:
|
||||
conf.env.SetConfigHeaderDefine("MONGO_CONFIG_HAVE_HEADER_UNISTD_H")
|
||||
|
@ -1144,14 +1144,12 @@ namespace {
|
||||
waitTime);
|
||||
}
|
||||
|
||||
try {
|
||||
if (waitTime == Microseconds::max()) {
|
||||
condVar.wait(*lock);
|
||||
}
|
||||
else {
|
||||
condVar.wait_for(*lock, waitTime);
|
||||
}
|
||||
} catch (const boost::thread_interrupted&) {}
|
||||
if (waitTime == Microseconds::max()) {
|
||||
condVar.wait(*lock);
|
||||
}
|
||||
else {
|
||||
condVar.wait_for(*lock, waitTime);
|
||||
}
|
||||
}
|
||||
|
||||
Status status = _checkIfWriteConcernCanBeSatisfied_inlock(writeConcern);
|
||||
|
Loading…
Reference in New Issue
Block a user