Files
oak-editor/app/common/threadedobject.cpp
T
lightyear15 2453b1d10c Code Cleanup: common: removing default constructors
As C++11 is the adopted standard, trivial constructors are not needed,
compiler can generate it for us.
2019-10-26 21:39:34 +02:00

34 lines
525 B
C++

#include "threadedobject.h"
void ThreadedObject::LockDeletes()
{
threadobj_delete_lock_++;
}
void ThreadedObject::UnlockDeletes()
{
Q_ASSERT(AreDeletesLocked());
threadobj_delete_lock_--;
}
bool ThreadedObject::AreDeletesLocked()
{
return (threadobj_delete_lock_ > 0);
}
void ThreadedObject::LockMutex()
{
threadobj_main_lock_.lock();
}
void ThreadedObject::UnlockMutex()
{
threadobj_main_lock_.unlock();
}
bool ThreadedObject::TryLockMutex(int timeout)
{
return threadobj_main_lock_.tryLock(timeout);
}