14#include <AUI/Traits/values.h>
15#include <AUI/Traits/memory.h>
24 AMutexWrapper(T value = T())
noexcept: mValue(std::move(value)) {}
41 value() = std::move(rhs);
45 template<
typename U, std::enable_if_t<std::is_constructible_v<U, T>>* = 0>
46 operator U()
noexcept {
52 mOwnerThread =
nullptr;
59 AUI_ASSERTX(mOwnerThread ==
AThread::current(),
"AMutexWrapper should be locked by this thread in order to get access to the underlying object");
64 T* operator->()
noexcept {
Wraps the object with mutex, providing thread-safety layer and a runtime check.
Definition: AMutexWrapper.h:22
static _< AAbstractThread > current()
Definition: AThread.cpp:221
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
#define AUI_ASSERTX(condition, what)
Asserts that the passed condition evaluates to true. Adds extra message string.
Definition: Assert.h:74
Basic syscall-based synchronization primitive.
Definition: AMutex.h:33
Forbids copy of your class.
Definition: values.h:40