]> git.proxmox.com Git - ceph.git/blame - ceph/src/common/AsyncOpTracker.h
update sources to v12.1.0
[ceph.git] / ceph / src / common / AsyncOpTracker.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_ASYNC_OP_TRACKER_H
5#define CEPH_ASYNC_OP_TRACKER_H
6
7c673cae
FG
7#include "common/Mutex.h"
8
9struct Context;
10
11class AsyncOpTracker {
12public:
13 AsyncOpTracker();
14 ~AsyncOpTracker();
15
16 void start_op();
17 void finish_op();
18
19 void wait_for_ops(Context *on_finish);
20
21 bool empty();
22
23private:
24 Mutex m_lock;
25 uint32_t m_pending_ops = 0;
26 Context *m_on_finish = nullptr;
27
28};
29
30#endif // CEPH_ASYNC_OP_TRACKER_H