Details
-
Improvement
-
Resolution: Fixed
-
Major - P3
-
None
-
Fully Compatible
-
v6.0
-
Service Arch 2022-06-27, Service Arch 2022-07-11
-
1
Description
Create a new RAII type that receives a unique_lock, unlocks it, and locks it again upon destruction:
stdx::unique_lock lk(mutex);
|
...
|
{
|
ScopedUnlockAndRelock scoped(lk);
|
// Do work without holding the lock |
}
|
One example for using this type is replacing the scope-guard in here:
_inPoll = true; |
lk.unlock();
|
|
const ScopeGuard guard([&] { |
lk.lock();
|
_inPoll = false; |
});
|
Attachments
Issue Links
- is related to
-
SERVER-49950 Address issues with ClockSource::setAlarm() and ClockSourceMock::_processAlarms()
-
- Closed
-
-
SERVER-63282 Refactor and simplify `BatonASIO`
-
- Closed
-