0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::db: No need for adopt_lock here.

This commit is contained in:
Jason Volk 2018-08-17 13:38:32 -07:00
parent a33b4b05de
commit eca3a5b85b

View file

@ -3377,12 +3377,7 @@ rocksdb::port::CondVar::Wait()
assert(mu);
assert_main_thread();
mu->AssertHeld();
std::unique_lock<decltype(mu->mu)> l
{
mu->mu, std::adopt_lock
};
cv.wait(l);
cv.wait(mu->mu);
}
// Returns true if timeout occurred
@ -3401,12 +3396,7 @@ rocksdb::port::CondVar::TimedWait(uint64_t abs_time_us)
mu->AssertHeld();
const std::chrono::microseconds us(abs_time_us);
const std::chrono::steady_clock::time_point tp(us);
std::unique_lock<decltype(mu->mu)> l
{
mu->mu, std::adopt_lock
};
return cv.wait_until(l, tp) == std::cv_status::timeout;
return cv.wait_until(mu->mu, tp) == std::cv_status::timeout;
}
void