1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

Use thread_local to protect globals from data race

This commit is contained in:
Matt
2019-03-31 16:51:55 +02:00
parent 4b1e7c3dd2
commit 1153b97ace
2 changed files with 8 additions and 8 deletions

View File

@@ -19,11 +19,11 @@
#include "../world/Water.h"
// HACK These were originally passed back through registers
int32_t gLastDrawStringX;
int32_t gLastDrawStringY;
thread_local int32_t gLastDrawStringX;
thread_local int32_t gLastDrawStringY;
int16_t gCurrentFontSpriteBase;
uint16_t gCurrentFontFlags;
thread_local int16_t gCurrentFontSpriteBase;
thread_local uint16_t gCurrentFontFlags;
uint8_t gGamePalette[256 * 4];
uint32_t gPaletteEffectFrame;

View File

@@ -237,8 +237,8 @@ struct rct_size16
#define MAX_SCROLLING_TEXT_MODES 38
extern int16_t gCurrentFontSpriteBase;
extern uint16_t gCurrentFontFlags;
extern thread_local int16_t gCurrentFontSpriteBase;
extern thread_local uint16_t gCurrentFontFlags;
extern rct_palette_entry gPalette[256];
extern uint8_t gGamePalette[256 * 4];
@@ -250,8 +250,8 @@ extern uint8_t gOtherPalette[256];
extern uint8_t text_palette[];
extern const translucent_window_palette TranslucentWindowPalettes[COLOUR_COUNT];
extern int32_t gLastDrawStringX;
extern int32_t gLastDrawStringY;
extern thread_local int32_t gLastDrawStringX;
extern thread_local int32_t gLastDrawStringY;
extern uint32_t gPickupPeepImage;
extern int32_t gPickupPeepX;