Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions include/ps/kv_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,18 +640,16 @@ void KVWorker<Val>::Process(const Message& msg) {
}
template <typename Val>
void KVWorker<Val>::RunCallback(int timestamp) {
Callback cb = nullptr;
mu_.lock();
auto it = callbacks_.find(timestamp);
if (it != callbacks_.end()) {
mu_.unlock();

CHECK(it->second);
it->second();

mu_.lock();
cb = it->second;
CHECK(cb);
callbacks_.erase(it);
}
mu_.unlock();
if (cb) cb();
}

template <typename Val>
Expand Down