blob: ba58f53694d9b027789b5d79773228be8938cb36 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/stllike/hash_map.h>
#include <mutex>
namespace search::bmcluster {
class PendingTracker;
/*
* Class maintaing mapping from message id to pending tracker
*/
class PendingTrackerHash
{
std::mutex _mutex;
vespalib::hash_map<uint64_t, PendingTracker *> _pending;
public:
PendingTrackerHash();
~PendingTrackerHash();
PendingTracker *release(uint64_t msg_id);
void retain(uint64_t msg_id, PendingTracker &tracker);
};
}
|