mirror of https://github.com/facebook/rocksdb.git
Avoid unnecessary unlock and lock mutex when notifying events.
Summary: Avoid unnecessary unlock and lock mutex when notifying events. Test Plan: ./listener_test Reviewers: igor Reviewed By: igor Subscribers: sdong, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D30267
This commit is contained in:
parent
7661e5a76e
commit
25f70a5abb
|
@ -1112,6 +1112,9 @@ Status DBImpl::FlushMemTableToOutputFile(
|
|||
void DBImpl::NotifyOnFlushCompleted(
|
||||
ColumnFamilyData* cfd, uint64_t file_number,
|
||||
const MutableCFOptions& mutable_cf_options) {
|
||||
if (cfd->ioptions()->listeners.size() == 0U) {
|
||||
return;
|
||||
}
|
||||
mutex_.AssertHeld();
|
||||
if (shutting_down_.load(std::memory_order_acquire)) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue