diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-02-15 11:56:16 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-02-15 12:32:25 +0000 |
commit | b8a7c3d7814ca8594ab14e497d143d9e3e2193ad (patch) | |
tree | 0e9cfccf44734dc1d873f891e0999ae741587956 /libadhocutil/semaphore.h | |
parent | Add Nagios passive check helpers (diff) | |
download | libadhocutil-b8a7c3d7814ca8594ab14e497d143d9e3e2193ad.tar.bz2 libadhocutil-b8a7c3d7814ca8594ab14e497d143d9e3e2193ad.tar.xz libadhocutil-b8a7c3d7814ca8594ab14e497d143d9e3e2193ad.zip |
Big modernize and tidy
Diffstat (limited to 'libadhocutil/semaphore.h')
-rw-r--r-- | libadhocutil/semaphore.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libadhocutil/semaphore.h b/libadhocutil/semaphore.h index 5c7bbea..bb20324 100644 --- a/libadhocutil/semaphore.h +++ b/libadhocutil/semaphore.h @@ -13,7 +13,7 @@ namespace AdHoc { class DLL_PUBLIC Semaphore { public: /// Construct a new semaphore with optional initial count. - Semaphore(unsigned int initial = 0); + explicit Semaphore(unsigned int initial = 0); /// Notify one waiting thread. void notify(); @@ -23,7 +23,7 @@ namespace AdHoc { /// @param ms Timeout in milliseconds. bool wait(unsigned int ms); /// Free - unsigned int freeCount() const; + [[nodiscard]] unsigned int freeCount() const; private: std::mutex mutex; |