]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/services/svc_finisher.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / rgw / services / svc_finisher.h
1 #ifndef CEPH_RGW_SERVICES_FINISHER_H
2 #define CEPH_RGW_SERVICES_FINISHER_H
3
4
5 #include "rgw/rgw_service.h"
6
7 class Context;
8 class Finisher;
9
10 class RGWSI_Finisher : public RGWServiceInstance
11 {
12 friend struct RGWServices_Def;
13 public:
14 class ShutdownCB;
15
16 private:
17 Finisher *finisher{nullptr};
18 bool finalized{false};
19
20 void shutdown() override;
21
22 std::map<int, ShutdownCB *> shutdown_cbs;
23 std::atomic<int> handles_counter{0};
24
25 protected:
26 void init() {}
27 int do_start() override;
28
29 public:
30 RGWSI_Finisher(CephContext *cct): RGWServiceInstance(cct) {}
31 ~RGWSI_Finisher();
32
33 class ShutdownCB {
34 public:
35 virtual ~ShutdownCB() {}
36 virtual void call() = 0;
37 };
38
39 void register_caller(ShutdownCB *cb, int *phandle);
40 void unregister_caller(int handle);
41
42 void schedule_context(Context *c);
43 };
44
45 #endif