mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-27 02:44:18 +00:00
Add a comment after SignalAll()
Summary: Having code after SignalAll has already caused 2 bugs. Let's make sure this doesn't happen again. Test Plan: no test Reviewers: sdong, dhruba, haobo Reviewed By: haobo CC: leveldb Differential Revision: https://reviews.facebook.net/D16785
This commit is contained in:
parent
01dcef114b
commit
cb9802168f
|
@ -1924,6 +1924,10 @@ void DBImpl::BackgroundCallFlush() {
|
||||||
MaybeScheduleFlushOrCompaction();
|
MaybeScheduleFlushOrCompaction();
|
||||||
}
|
}
|
||||||
bg_cv_.SignalAll();
|
bg_cv_.SignalAll();
|
||||||
|
// IMPORTANT: there should be no code after calling SignalAll. This call may
|
||||||
|
// signal the DB destructor that it's OK to proceed with destruction. In
|
||||||
|
// that case, all DB variables will be dealloacated and referencing them
|
||||||
|
// will cause trouble.
|
||||||
}
|
}
|
||||||
log_buffer.FlushBufferToLog();
|
log_buffer.FlushBufferToLog();
|
||||||
}
|
}
|
||||||
|
@ -1993,6 +1997,10 @@ void DBImpl::BackgroundCallCompaction() {
|
||||||
MaybeScheduleFlushOrCompaction();
|
MaybeScheduleFlushOrCompaction();
|
||||||
}
|
}
|
||||||
bg_cv_.SignalAll();
|
bg_cv_.SignalAll();
|
||||||
|
// IMPORTANT: there should be no code after calling SignalAll. This call may
|
||||||
|
// signal the DB destructor that it's OK to proceed with destruction. In
|
||||||
|
// that case, all DB variables will be dealloacated and referencing them
|
||||||
|
// will cause trouble.
|
||||||
}
|
}
|
||||||
log_buffer.FlushBufferToLog();
|
log_buffer.FlushBufferToLog();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue