From c9f28ce0941ef1727242005ff1cd18c4b741aef3 Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Wed, 29 Aug 2018 11:13:13 +0200 Subject: [PATCH] Forbid copying classes in threading --- src/base/tl/threading.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/base/tl/threading.h b/src/base/tl/threading.h index 5453d2b3a..c5a972adc 100644 --- a/src/base/tl/threading.h +++ b/src/base/tl/threading.h @@ -67,6 +67,7 @@ class semaphore public: semaphore() { sphore_init(&sem); } ~semaphore() { sphore_destroy(&sem); } + semaphore(const semaphore&) = delete; void wait() { sphore_wait(&sem); } void signal() { sphore_signal(&sem); } }; @@ -86,6 +87,8 @@ public: lock_destroy(var); } + lock(const lock&) = delete; + void take() { lock_wait(var); } void release() { lock_unlock(var); } }; @@ -104,6 +107,8 @@ public: { var->release(); } + + scope_lock(const scope_lock&) = delete; }; #endif // BASE_TL_THREADING_H