From a994f0bd1d247386d5fab878f8a23450ca13b970 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Thu, 4 Dec 2014 17:12:57 -0700 Subject: [PATCH] Make avltree.o state thread-local. --- src/microcode/avltree.c | 6 +++--- src/microcode/avltree.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/microcode/avltree.c b/src/microcode/avltree.c index e4bf2248e..982838e63 100644 --- a/src/microcode/avltree.c +++ b/src/microcode/avltree.c @@ -32,8 +32,8 @@ USA. extern int strcmp_ci (const char *, const char *); -const char * tree_error_message = 0; -const char * tree_error_noise = 0; +__thread const char * tree_error_message = 0; +__thread const char * tree_error_noise = 0; static void tree_error (const char * message, const char * noise) @@ -191,7 +191,7 @@ tree_lookup (tree_node tree, const char * name) tree_node tree_build (unsigned long high, const char ** names, unsigned long value) { - static long bias = 0; + static __thread long bias = 0; if (high > 1) { tree_node tree; diff --git a/src/microcode/avltree.h b/src/microcode/avltree.h index a28890cf9..ce1cb56b6 100644 --- a/src/microcode/avltree.h +++ b/src/microcode/avltree.h @@ -34,8 +34,8 @@ USA. #include "config.h" -extern const char * tree_error_message; -extern const char * tree_error_noise; +extern __thread const char * tree_error_message; +extern __thread const char * tree_error_noise; typedef struct tree_node_s * tree_node; -- 2.25.1