diff --git a/include/rw_lock.h b/include/rw_lock.h index 5e91428..c52766a 100644 --- a/include/rw_lock.h +++ b/include/rw_lock.h @@ -71,7 +71,7 @@ inline void yield(K& k) noexcept { } template -inline void sleep(K& k, F&& f) noexcept { +inline void sleep(K& k, F&& f) { if (k < static_cast(N)) { std::this_thread::yield(); } @@ -86,7 +86,7 @@ inline void sleep(K& k, F&& f) noexcept { } template -inline void sleep(K& k) noexcept { +inline void sleep(K& k) { sleep(k, [] { return false; }); } diff --git a/src/platform/waiter_linux.h b/src/platform/waiter_linux.h index 5c9d7e1..c152fcf 100644 --- a/src/platform/waiter_linux.h +++ b/src/platform/waiter_linux.h @@ -105,9 +105,9 @@ public: #pragma pop_macro("IPC_PTHREAD_FUNC_") class semaphore { - mutex lock_; - condition cond_; - long volatile counter_; + mutex lock_; + condition cond_; + long counter_; public: bool open(long count = 0) { diff --git a/src/platform/waiter_win.h b/src/platform/waiter_win.h index d780e2a..eb17156 100644 --- a/src/platform/waiter_win.h +++ b/src/platform/waiter_win.h @@ -62,7 +62,7 @@ class condition { mutex lock_; semaphore sema_, handshake_; - long volatile * counter_ = nullptr; + long * counter_ = nullptr; public: friend bool operator==(condition const & c1, condition const & c2) { @@ -73,7 +73,7 @@ public: return !(c1 == c2); } - bool open(std::string const & name, long volatile * counter) { + bool open(std::string const & name, long * counter) { if (lock_ .open(name + "__COND_MTX__") && sema_ .open(name + "__COND_SEM__") && handshake_.open(name + "__COND_HAN__")) { @@ -130,7 +130,7 @@ public: }; class waiter { - long volatile counter_ = 0; + long counter_ = 0; public: using handle_t = condition; diff --git a/src/platform/waiter_wrapper.h b/src/platform/waiter_wrapper.h index d1545a5..1b0a558 100644 --- a/src/platform/waiter_wrapper.h +++ b/src/platform/waiter_wrapper.h @@ -25,7 +25,7 @@ class condition_impl : public ipc::detail::condition { public: bool open(std::string const & name) { if (h_.acquire((name + "__COND_CNT__").c_str(), sizeof(long volatile))) { - return ipc::detail::condition::open(name, static_cast(h_.get())); + return ipc::detail::condition::open(name, static_cast(h_.get())); } return false; }