]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab ft=cpp | |
11fdf7f2 | 3 | |
9f95a23c | 4 | #pragma once |
11fdf7f2 TL |
5 | |
6 | #include "rgw/rgw_service.h" | |
7 | ||
8 | class Context; | |
9 | class Finisher; | |
10 | ||
11 | class RGWSI_Finisher : public RGWServiceInstance | |
12 | { | |
13 | friend struct RGWServices_Def; | |
14 | public: | |
15 | class ShutdownCB; | |
16 | ||
17 | private: | |
18 | Finisher *finisher{nullptr}; | |
19 | bool finalized{false}; | |
20 | ||
21 | void shutdown() override; | |
22 | ||
23 | std::map<int, ShutdownCB *> shutdown_cbs; | |
24 | std::atomic<int> handles_counter{0}; | |
25 | ||
26 | protected: | |
27 | void init() {} | |
b3b6e05e | 28 | int do_start(optional_yield y, const DoutPrefixProvider *dpp) override; |
11fdf7f2 TL |
29 | |
30 | public: | |
31 | RGWSI_Finisher(CephContext *cct): RGWServiceInstance(cct) {} | |
32 | ~RGWSI_Finisher(); | |
33 | ||
34 | class ShutdownCB { | |
35 | public: | |
36 | virtual ~ShutdownCB() {} | |
37 | virtual void call() = 0; | |
38 | }; | |
39 | ||
40 | void register_caller(ShutdownCB *cb, int *phandle); | |
41 | void unregister_caller(int handle); | |
42 | ||
43 | void schedule_context(Context *c); | |
44 | }; |