]> git.proxmox.com Git - ceph.git/blob - ceph/src/tools/rbd_mirror/Threads.h
import ceph quincy 17.2.4
[ceph.git] / 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 "include/common_fwd.h"
8 #include "include/rados/librados_fwd.hpp"
9 #include "common/ceph_mutex.h"
10 #include "common/Timer.h"
11 #include <memory>
12
13 class ThreadPool;
14
15 namespace librbd {
16 struct AsioEngine;
17 struct ImageCtx;
18 namespace asio { struct ContextWQ; }
19 } // namespace librbd
20
21 namespace rbd {
22 namespace mirror {
23
24 template <typename ImageCtxT = librbd::ImageCtx>
25 class Threads {
26 public:
27 librbd::AsioEngine* asio_engine = nullptr;
28 librbd::asio::ContextWQ* work_queue = nullptr;
29
30 SafeTimer *timer = nullptr;
31 ceph::mutex timer_lock = ceph::make_mutex("Threads::timer_lock");
32
33 explicit Threads(std::shared_ptr<librados::Rados>& rados);
34 Threads(const Threads&) = delete;
35 Threads& operator=(const Threads&) = delete;
36
37 ~Threads();
38 };
39
40 } // namespace mirror
41 } // namespace rbd
42
43 extern template class rbd::mirror::Threads<librbd::ImageCtx>;
44
45 #endif // CEPH_RBD_MIRROR_THREADS_H