mirror of
https://github.com/Relintai/sfw.git
synced 2024-12-20 21:06:49 +01:00
23 lines
678 B
C
23 lines
678 B
C
//--STRIP
|
|
#ifndef THREAD_SAFE_H
|
|
#define THREAD_SAFE_H
|
|
//--STRIP
|
|
|
|
/*************************************************************************/
|
|
/* 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();
|
|
|
|
//--STRIP
|
|
#endif
|
|
//--STRIP
|