mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-23 12:23:06 +00:00
Use platform TLS keys for entity small IDs
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
#include "../Util/Vec3.h"
|
||||
#include "../Util/Definitions.h"
|
||||
#include "../Util/SoundTypes.h"
|
||||
#if !defined(_WIN32)
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
|
||||
class GrassTile;
|
||||
@@ -55,7 +58,11 @@ protected:
|
||||
int tileId;
|
||||
ThreadStorage();
|
||||
};
|
||||
#if defined(_WIN32)
|
||||
static DWORD tlsIdxShape;
|
||||
#else
|
||||
static pthread_key_t tlsIdxShape;
|
||||
#endif
|
||||
public:
|
||||
// Each new thread that needs to use Vec3 pools will need to call one of the following 2 functions, to either create its own
|
||||
// local storage, or share the default storage already allocated by the main thread
|
||||
|
||||
Reference in New Issue
Block a user