Skip to content

Commit

Permalink
os/bluestore: fix race condition
Browse files Browse the repository at this point in the history
The empty() method also needs to be called under the protection of lock.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
  • Loading branch information
xiexingguo committed Sep 10, 2016
1 parent 836715a commit 1ab12fa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/os/bluestore/BlueStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ class BlueStore : public ObjectStore,
}

bool empty() {
std::lock_guard<std::mutex> l(lock);
return uset.empty();
}
};
Expand Down

0 comments on commit 1ab12fa

Please sign in to comment.