aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/shutdown_state.h
blob: 10104c1d9aa02829253901325bc086c6a6271b4f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include "misc/atomic_box.h" 
 
#include <util/system/event.h>

enum EShutdownState {
    SS_RUNNING,
    SS_SHUTDOWN_COMMAND,
    SS_SHUTDOWN_COMPLETE,
};

struct TAtomicShutdownState {
    TAtomicBox<EShutdownState> State;
    TSystemEvent ShutdownComplete;

    void ShutdownCommand();
    void CompleteShutdown();
    bool IsRunning();

    ~TAtomicShutdownState();
};