}
void TestWatchNotify::flush() {
+ // block until we know no additional async notify callbacks will occur
Mutex::Locker locker(m_lock);
while (m_pending_notifies > 0) {
m_file_watcher_cond.Wait(m_lock);
}
finish_notify(oid, notify_id);
+
+ if (--m_pending_notifies == 0) {
+ m_file_watcher_cond.Signal();
+ }
}
void TestWatchNotify::ack_notify(const std::string &oid,
if (watcher->watch_handles.empty() && watcher->notify_handles.empty()) {
m_file_watchers.erase(oid);
}
-
- if (--m_pending_notifies == 0) {
- m_file_watcher_cond.Signal();
- }
}
} // namespace librados