diff options
Diffstat (limited to 'proto-ft/mutex.hpp')
-rw-r--r-- | proto-ft/mutex.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/proto-ft/mutex.hpp b/proto-ft/mutex.hpp new file mode 100644 index 00000000..f92a14bf --- /dev/null +++ b/proto-ft/mutex.hpp @@ -0,0 +1,16 @@ +#pragma once + +class check_for_first_run final +{ + bool checked_for_first_run; + bool is_first_instance; + bool enabled; + + void try_exit(); +public: + check_for_first_run(); + bool is_first_run(); + void set_enabled(bool flag); + void try_runonce(); + ~check_for_first_run(); +}; |