aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/actors/util/should_continue.cpp
blob: 258e6a0aff26231a5002a2f3d361243cb9bd4b14 (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
#include "should_continue.h"

void TProgramShouldContinue::ShouldRestart() {
    AtomicSet(State, Restart);
}

void TProgramShouldContinue::ShouldStop(int returnCode) {
    AtomicSet(ReturnCode, returnCode);
    AtomicSet(State, Stop);
}

TProgramShouldContinue::EState TProgramShouldContinue::PollState() {
    return static_cast<EState>(AtomicGet(State));
}

int TProgramShouldContinue::GetReturnCode() {
    return static_cast<int>(AtomicGet(ReturnCode));
}

void TProgramShouldContinue::Reset() {
    AtomicSet(ReturnCode, 0);
    AtomicSet(State, Continue);
}