aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/common/flush_token.cpp
blob: 50e9380d2a95a20d1dbab7a03d3f0e367449203c (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.

#include "flush_token.h"

namespace search {

FlushToken::FlushToken()
    : _stop(false)
{
}

FlushToken::~FlushToken() = default;

bool
FlushToken::stop_requested() const noexcept
{
    return _stop.load(std::memory_order_relaxed);
}

void
FlushToken::request_stop() noexcept
{
    _stop.store(true, std::memory_order_relaxed);
}

}