From 0ec4da960d34e3859dd42cd4f25d2515e101de35 Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 9 Feb 2015 22:43:08 -0800 Subject: [PATCH] picture_csp::InitGammaTables*: add missing TSan annotations Change-Id: I66ca5b3e7b1614f861a9b68bd437f58b24cb1ebb --- src/enc/picture_csp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/enc/picture_csp.c b/src/enc/picture_csp.c index 01bfceaf..9c8305c7 100644 --- a/src/enc/picture_csp.c +++ b/src/enc/picture_csp.c @@ -85,9 +85,9 @@ int WebPPictureHasTransparency(const WebPPicture* picture) { static int kLinearToGammaTab[kGammaTabSize + 1]; static uint16_t kGammaToLinearTab[256]; -static int kGammaTablesOk = 0; +static volatile int kGammaTablesOk = 0; -static void InitGammaTables(void) { +static WEBP_TSAN_IGNORE_FUNCTION void InitGammaTables(void) { if (!kGammaTablesOk) { int v; const double scale = (double)(1 << kGammaTabFix) / kGammaScale; @@ -126,7 +126,7 @@ static WEBP_INLINE int LinearToGamma(uint32_t base_value, int shift) { #else -static void InitGammaTables(void) {} +static WEBP_TSAN_IGNORE_FUNCTION void InitGammaTables(void) {} static WEBP_INLINE uint32_t GammaToLinear(uint8_t v) { return v; } static WEBP_INLINE int LinearToGamma(uint32_t base_value, int shift) { return (int)(base_value << shift); @@ -180,9 +180,9 @@ typedef uint16_t fixed_y_t; // unsigned type with extra YFIX precision for W #define kGammaF 2.2 static float kGammaToLinearTabF[MAX_Y_T + 1]; // size scales with Y_FIX static float kLinearToGammaTabF[kGammaTabSize + 2]; -static int kGammaTablesFOk = 0; +static volatile int kGammaTablesFOk = 0; -static void InitGammaTablesF(void) { +static WEBP_TSAN_IGNORE_FUNCTION void InitGammaTablesF(void) { if (!kGammaTablesFOk) { int v; const double norm = 1. / MAX_Y_T; @@ -215,7 +215,7 @@ static WEBP_INLINE int LinearToGammaF(float value) { #else -static void InitGammaTablesF(void) {} +static WEBP_TSAN_IGNORE_FUNCTION void InitGammaTablesF(void) {} static WEBP_INLINE float GammaToLinearF(int v) { const float norm = 1.f / MAX_Y_T; return norm * v;