[Core] Allow locking/unlocking of MutexLock
This commit is contained in:
@ -103,6 +103,16 @@ public:
|
||||
~MutexLock() {
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
_ALWAYS_INLINE_ void temp_relock() const {
|
||||
mutex.lock();
|
||||
}
|
||||
|
||||
_ALWAYS_INLINE_ void temp_unlock() const {
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
// TODO: Implement a `try_temp_relock` if needed (will also need a dummy method below).
|
||||
};
|
||||
|
||||
#else // No threads.
|
||||
@ -119,6 +129,16 @@ public:
|
||||
void unlock() const {}
|
||||
};
|
||||
|
||||
template <int Tag>
|
||||
class MutexLock<SafeBinaryMutex<Tag>> {
|
||||
public:
|
||||
MutexLock(const SafeBinaryMutex<Tag> &p_mutex) {}
|
||||
~MutexLock() {}
|
||||
|
||||
void temp_relock() const {}
|
||||
void temp_unlock() const {}
|
||||
};
|
||||
|
||||
#endif // THREADS_ENABLED
|
||||
|
||||
#endif // SAFE_BINARY_MUTEX_H
|
||||
|
||||
Reference in New Issue
Block a user