Handle multiple calls to DBImpl::PauseBackgroundWork() and DBImpl::ContinueBackgroundWork()
Summary: Handle multiple calls to DBImpl::PauseBackgroundWork() and DBImpl::ContinueBackgroundWork() Test Plan: rocksdb.information_schema handles this case. Reviewers: igor Reviewed By: igor Subscribers: hermanlee4, jkedgar, dhruba Differential Revision: https://reviews.facebook.net/D50781
This commit is contained in:
parent
65a042921f
commit
3381e2c3e7
@ -1850,6 +1850,9 @@ Status DBImpl::PauseBackgroundWork() {
|
||||
|
||||
Status DBImpl::ContinueBackgroundWork() {
|
||||
InstrumentedMutexLock guard_lock(&mutex_);
|
||||
if (bg_work_paused_ == 0) {
|
||||
return Status::InvalidArgument();
|
||||
}
|
||||
assert(bg_work_paused_ > 0);
|
||||
bg_work_paused_--;
|
||||
if (bg_work_paused_ == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user