From b6af7abb1ab53bc62a9d190f19331ad5e3794d93 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 18 Dec 2017 23:29:08 +0100 Subject: thread/PosixMutex: add "noexcept" --- src/thread/PosixMutex.hxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/thread') diff --git a/src/thread/PosixMutex.hxx b/src/thread/PosixMutex.hxx index c3f2ac23f..7042dc8ec 100644 --- a/src/thread/PosixMutex.hxx +++ b/src/thread/PosixMutex.hxx @@ -48,11 +48,11 @@ public: #else /* slow fallback for pthread implementations that are not compatible with "constexpr" */ - PosixMutex() { + PosixMutex() noexcept { pthread_mutex_init(&mutex, nullptr); } - ~PosixMutex() { + ~PosixMutex() noexcept { pthread_mutex_destroy(&mutex); } #endif @@ -60,15 +60,15 @@ public: PosixMutex(const PosixMutex &other) = delete; PosixMutex &operator=(const PosixMutex &other) = delete; - void lock() { + void lock() noexcept { pthread_mutex_lock(&mutex); } - bool try_lock() { + bool try_lock() noexcept { return pthread_mutex_trylock(&mutex) == 0; } - void unlock() { + void unlock() noexcept { pthread_mutex_unlock(&mutex); } }; -- cgit v1.2.3