aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/common/flush_token.h
blob: 8a38384629545bcc74d752bba739d1ccf175d46f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "i_flush_token.h"
#include <atomic>

namespace search {

/*
 * Class for checking if current flush task should be stopped.
 */
class FlushToken : public IFlushToken {
    std::atomic<bool> _stop;
public:
    FlushToken();
    ~FlushToken() override;
    bool stop_requested() const noexcept override;
    void request_stop() noexcept;
};

}