]> git.proxmox.com Git - ceph.git/blame - ceph/src/rgw/services/svc_finisher.h
import ceph pacific 16.2.5
[ceph.git] / ceph / src / rgw / services / svc_finisher.h
CommitLineData
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
8class Context;
9class Finisher;
10
11class RGWSI_Finisher : public RGWServiceInstance
12{
13 friend struct RGWServices_Def;
14public:
15 class ShutdownCB;
16
17private:
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
26protected:
27 void init() {}
b3b6e05e 28 int do_start(optional_yield y, const DoutPrefixProvider *dpp) override;
11fdf7f2
TL
29
30public:
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};