#include <boost/algorithm/string/predicate.hpp>
#include <dlfcn.h>
#include <errno.h>
+#include "common/debug.h"
+
+#define dout_subsys ceph_subsys_rados
namespace librados {
const std::string& path) {
void *handle = dlopen(path.c_str(), RTLD_NOW);
if (handle == NULL) {
- std::cerr << "Failed to load class: " << dlerror() << std::endl;
+ derr << "Failed to load class: " << dlerror() << dendl;
return;
}
m_class_handles.push_back(handle);
#include "test/librados_test_stub/TestWatchNotify.h"
#include "librados/AioCompletionImpl.h"
#include "include/assert.h"
+#include "common/valgrind.h"
#include "objclass/objclass.h"
#include <boost/bind.hpp>
#include <errno.h>
void TestObjectOperationImpl::put() {
if (m_refcount.dec() == 0) {
+ ANNOTATE_HAPPENS_AFTER(&m_refcount);
+ ANNOTATE_HAPPENS_BEFORE_FORGET_ALL(&m_refcount);
delete this;
+ } else {
+ ANNOTATE_HAPPENS_BEFORE(&m_refcount);
}
}
bufferlist &bl, uint64_t notify_id,
Mutex *lock, Cond *cond,
bool *done) {
- SharedWatcher watcher = get_watcher(oid);
- RWLock::RLocker l(watcher->lock);
+ WatchHandles watch_handles;
+ SharedNotifyHandle notify_handle;
- utime_t timeout;
- timeout.set_from_double(ceph_clock_now(m_cct) + 15);
+ {
+ SharedWatcher watcher = get_watcher(oid);
+ RWLock::RLocker l(watcher->lock);
- NotifyHandles::iterator n_it = watcher->notify_handles.find(notify_id);
- if (n_it == watcher->notify_handles.end()) {
- return;
+ NotifyHandles::iterator n_it = watcher->notify_handles.find(notify_id);
+ if (n_it == watcher->notify_handles.end()) {
+ return;
+ }
+
+ watch_handles = watcher->watch_handles;
+ notify_handle = n_it->second;
}
- SharedNotifyHandle notify_handle = n_it->second;
- for (WatchHandles::iterator w_it = watcher->watch_handles.begin();
- w_it != watcher->watch_handles.end(); ++w_it) {
+ utime_t timeout;
+ timeout.set_from_double(ceph_clock_now(m_cct) + 15);
+
+ for (WatchHandles::iterator w_it = watch_handles.begin();
+ w_it != watch_handles.end(); ++w_it) {
WatchHandle &watch_handle = w_it->second;
bufferlist notify_bl;