blob: a440e3a053f96c1bc406d6113760e6e7cca51935 (
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
27
28
29
30
31
32
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "distributor_status.h"
#include "delegatedstatusrequest.h"
namespace storage::distributor {
std::ostream& DistributorStatus::getStream() {
return _request.outputStream;
}
const framework::HttpUrlPath& DistributorStatus::getPath() const {
return _request.path;
}
const framework::StatusReporter& DistributorStatus::getReporter() const {
return _request.reporter;
}
void DistributorStatus::notifyCompleted() {
{
std::lock_guard guard(_lock);
_done = true;
}
_cond.notify_all();
}
void DistributorStatus::waitForCompletion() {
std::unique_lock guard(_lock);
while (!_done) {
_cond.wait(guard);
}
}
}
|