]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 | ||
9f95a23c | 7 | #include "include/common_fwd.h" |
f67539c2 | 8 | #include "include/rados/librados_fwd.hpp" |
9f95a23c | 9 | #include "common/ceph_mutex.h" |
f67539c2 | 10 | #include <memory> |
7c673cae | 11 | |
7c673cae FG |
12 | class SafeTimer; |
13 | class ThreadPool; | |
14 | ||
f67539c2 TL |
15 | namespace librbd { |
16 | struct AsioEngine; | |
17 | struct ImageCtx; | |
18 | namespace asio { struct ContextWQ; } | |
19 | } // namespace librbd | |
7c673cae FG |
20 | |
21 | namespace rbd { | |
22 | namespace mirror { | |
23 | ||
24 | template <typename ImageCtxT = librbd::ImageCtx> | |
f67539c2 TL |
25 | class Threads { |
26 | public: | |
27 | librbd::AsioEngine* asio_engine = nullptr; | |
28 | librbd::asio::ContextWQ* work_queue = nullptr; | |
7c673cae FG |
29 | |
30 | SafeTimer *timer = nullptr; | |
f67539c2 | 31 | ceph::mutex timer_lock = ceph::make_mutex("Threads::timer_lock"); |
7c673cae | 32 | |
f67539c2 | 33 | explicit Threads(std::shared_ptr<librados::Rados>& rados); |
7c673cae FG |
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 |