Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / tools / rbd_mirror / Threads.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #ifndef CEPH_RBD_MIRROR_THREADS_H
5 #define CEPH_RBD_MIRROR_THREADS_H
6
7 #include "common/Mutex.h"
8
9 class CephContext;
10 class ContextWQ;
11 class SafeTimer;
12 class ThreadPool;
13
14 namespace librbd { struct ImageCtx; }
15
16 namespace rbd {
17 namespace mirror {
18
19 template <typename ImageCtxT = librbd::ImageCtx>
20 struct Threads {
21   ThreadPool *thread_pool = nullptr;
22   ContextWQ *work_queue = nullptr;
23
24   SafeTimer *timer = nullptr;
25   Mutex timer_lock;
26
27   explicit Threads(CephContext *cct);
28   Threads(const Threads&) = delete;
29   Threads& operator=(const Threads&) = delete;
30
31   ~Threads();
32 };
33
34 } // namespace mirror
35 } // namespace rbd
36
37 extern template class rbd::mirror::Threads<librbd::ImageCtx>;
38
39 #endif // CEPH_RBD_MIRROR_THREADS_H