2024-01-20 10:27:23 +01:00
|
|
|
//--STRIP
|
2024-01-07 10:49:16 +01:00
|
|
|
#ifndef THREAD_SAFE_H
|
|
|
|
#define THREAD_SAFE_H
|
2024-01-20 10:27:23 +01:00
|
|
|
//--STRIP
|
2024-01-07 10:49:16 +01:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* thread_safe.h */
|
|
|
|
/* From https://github.com/Relintai/pandemonium_engine (MIT) */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
//--STRIP
|
|
|
|
#include "core/mutex.h"
|
|
|
|
//--STRIP
|
|
|
|
|
|
|
|
#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();
|
|
|
|
|
2024-01-20 10:27:23 +01:00
|
|
|
//--STRIP
|
2024-01-07 10:49:16 +01:00
|
|
|
#endif
|
2024-01-20 10:27:23 +01:00
|
|
|
//--STRIP
|