summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-12-18 23:29:08 +0100
committerMax Kellermann <max@musicpd.org>2017-12-18 23:29:08 +0100
commitb6af7abb1ab53bc62a9d190f19331ad5e3794d93 (patch)
treef4421f75ca3bd336c45fc01bff50e06607c8a97b /src
parentedee8a34465ba299fcfa29415586158de0513205 (diff)
thread/PosixMutex: add "noexcept"
Diffstat (limited to 'src')
-rw-r--r--src/thread/PosixMutex.hxx10
1 files changed, 5 insertions, 5 deletions
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);
}
};