Cross platform thread local

main
Cameron Murphy Reikes 2 years ago
parent 6f68127aa7
commit 6014225276

@ -27,8 +27,15 @@ typedef struct Command
// thread local variables so debug drawing in server thread // thread local variables so debug drawing in server thread
// doesn't fuck up main thread // doesn't fuck up main thread
static __declspec(thread) Command commands[MAX_COMMANDS] = {0};
static __declspec(thread) int command_i = 0; #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#define THREADLOCAL __declspec(thread)
#else
#define THREADLOCAL __thread
#endif
static THREADLOCAL Command commands[MAX_COMMANDS] = {0};
static THREADLOCAL int command_i = 0;
void dbg_drawall() void dbg_drawall()
{ {

Loading…
Cancel
Save