瀏覽代碼

LibThreading: Neither Mutex or MutexLocker should be movable / copyable

Brian Gianforcaro 3 年之前
父節點
當前提交
bff33c67ab
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Userland/Libraries/LibThreading/Mutex.h

+ 5 - 0
Userland/Libraries/LibThreading/Mutex.h

@@ -13,6 +13,8 @@
 namespace Threading {
 namespace Threading {
 
 
 class Mutex {
 class Mutex {
+    AK_MAKE_NONCOPYABLE(Mutex);
+    AK_MAKE_NONMOVABLE(Mutex);
     friend class ConditionVariable;
     friend class ConditionVariable;
 
 
 public:
 public:
@@ -39,6 +41,9 @@ private:
 };
 };
 
 
 class MutexLocker {
 class MutexLocker {
+    AK_MAKE_NONCOPYABLE(MutexLocker);
+    AK_MAKE_NONMOVABLE(MutexLocker);
+
 public:
 public:
     ALWAYS_INLINE explicit MutexLocker(Mutex& mutex)
     ALWAYS_INLINE explicit MutexLocker(Mutex& mutex)
         : m_mutex(mutex)
         : m_mutex(mutex)