]> git.proxmox.com Git - ceph.git/blame - ceph/src/tools/rbd_mirror/Threads.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / tools / rbd_mirror / Threads.h
CommitLineData
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
12class SafeTimer;
13class ThreadPool;
14
f67539c2
TL
15namespace librbd {
16struct AsioEngine;
17struct ImageCtx;
18namespace asio { struct ContextWQ; }
19} // namespace librbd
7c673cae
FG
20
21namespace rbd {
22namespace mirror {
23
24template <typename ImageCtxT = librbd::ImageCtx>
f67539c2
TL
25class Threads {
26public:
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
43extern template class rbd::mirror::Threads<librbd::ImageCtx>;
44
45#endif // CEPH_RBD_MIRROR_THREADS_H