summaryrefslogtreecommitdiff
path: root/libadhocutil/semaphore.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-02-15 11:56:16 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-02-15 12:32:25 +0000
commitb8a7c3d7814ca8594ab14e497d143d9e3e2193ad (patch)
tree0e9cfccf44734dc1d873f891e0999ae741587956 /libadhocutil/semaphore.h
parentAdd Nagios passive check helpers (diff)
downloadlibadhocutil-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.h4
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;