diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-08-22 13:58:49 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-08-22 13:58:49 +0100 |
commit | 172567f6ee168846b41d11ed7b8bd9c1ccbb659b (patch) | |
tree | 31cb78c4dedc32e9629815b855ecc7bedfcaf0b0 /test/semaphore.h | |
parent | Add EventCounter class (diff) | |
download | mygrate-172567f6ee168846b41d11ed7b8bd9c1ccbb659b.tar.bz2 mygrate-172567f6ee168846b41d11ed7b8bd9c1ccbb659b.tar.xz mygrate-172567f6ee168846b41d11ed7b8bd9c1ccbb659b.zip |
Wait on specific events being processed
Diffstat (limited to 'test/semaphore.h')
-rw-r--r-- | test/semaphore.h | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/test/semaphore.h b/test/semaphore.h deleted file mode 100644 index 6a5963f..0000000 --- a/test/semaphore.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef MYGRATE_TEST_SEMAPHORE_H -#define MYGRATE_TEST_SEMAPHORE_H - -#if __has_include(<semaphore>) -# include <semaphore> -#endif - -#ifdef __cpp_lib_semaphore -using semaphore = std::binary_semaphore; -#else -# include <mutex> -class semaphore { -public: - explicit semaphore(unsigned int v_); - - void release(unsigned int n = 1); - - void acquire(); - -private: - bool try_dec(); - unsigned int v; - std::mutex m; -}; -#endif - -#endif |