diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-05-22 12:49:41 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-05-22 12:49:41 +0200 |
commit | c6819cfa0213a72be66c7e6c9808fd1b7ad9ce03 (patch) | |
tree | 16cece5699eebeeda67f58f825a8418824c17104 /proto-ft/mutex.hpp | |
parent | 78d34c3285bbdc8ba30bf07d06235f68f73346fb (diff) |
proto/freetrack: runonce check can be a static member
Now that we have -fuse-cxa-atexit static dtors for modules are called as
they should be.
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(); +}; |