pandemonium_engine_minimal/core/os/thread_safe.h

15 lines
394 B
C++
Raw Normal View History

2023-12-14 21:54:22 +01:00
#ifndef THREAD_SAFE_H
#define THREAD_SAFE_H
2023-12-14 21:54:22 +01:00
/* thread_safe.h */
2023-12-14 21:54:22 +01:00
#include "core/os/mutex.h"
#define _THREAD_SAFE_CLASS_ mutable Mutex _thread_safe_;
#define _THREAD_SAFE_METHOD_ MutexLock _thread_safe_method_(_thread_safe_);
#define _THREAD_SAFE_LOCK_ _thread_safe_.lock();
#define _THREAD_SAFE_UNLOCK_ _thread_safe_.unlock();
#endif