#pragma once

#ifndef CLOSE_EVENT_4FD57563_F068_4b77_B1FE_676887F0F722
#define CLOSE_EVENT_4FD57563_F068_4b77_B1FE_676887F0F722

#include <exception>
#include <wmconsole/legacy/util/event.h>

namespace NWebmaster {

struct t_close_event {
    static threads::event &instance() {
        static threads::event evClose;
        return evClose;
    }

    static void check() {
        if (instance().is_setted()) {
            throw std::logic_error("Close event occured");
        }
    }

private:
    t_close_event();
};

} //namespace NWebmaster

#endif //CLOSE_EVENT_4FD57563_F068_4b77_B1FE_676887F0F722
