14#include <AUI/Traits/values.h>
15#include <AUI/Traits/memory.h>
24 AMutexWrapper(T value = T())
noexcept: mValue(std::move(value)) {}
35 AMutexWrapper& operator=(
const T& rhs) {
40 AMutexWrapper& operator=(T&& rhs)
noexcept {
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 {
static _< AAbstractThread > current()
Definition AThread.cpp:197
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:178
#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