]>
git.proxmox.com Git - ceph.git/blob - ceph/src/test/immutable_object_cache/test_common.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 #ifndef CACHE_TEST_COMMON_H
4 #define CACHE_TEST_COMMON_H
10 WaitEvent() : m_signaled(false) {
11 pthread_mutex_init(&m_lock
, NULL
);
12 pthread_cond_init(&m_cond
, NULL
);
16 pthread_mutex_destroy(&m_lock
);
17 pthread_cond_destroy(&m_cond
);
21 pthread_mutex_lock(&m_lock
);
23 pthread_cond_wait(&m_cond
, &m_lock
);
26 pthread_mutex_unlock(&m_lock
);
30 pthread_mutex_lock(&m_lock
);
32 pthread_cond_signal(&m_cond
);
33 pthread_mutex_unlock(&m_lock
);
36 pthread_mutex_t m_lock
;
37 pthread_cond_t m_cond
;