diff options
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 |