1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00

LibThreading: Neither Mutex or MutexLocker should be movable / copyable

This commit is contained in:
Brian Gianforcaro 2021-09-16 00:19:27 -07:00 committed by Andreas Kling
parent fdea5e1628
commit bff33c67ab

View file

@ -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)