From f6286a4174bc272deeabec84bb94361be7c1b2c5 Mon Sep 17 00:00:00 2001
From: Matt Birkholz <puck@birchwood-abbey.net>
Date: Fri, 5 Dec 2014 10:51:44 -0700
Subject: [PATCH] smp: share: obstack.o

---
 README.txt              | 4 +++-
 src/microcode/obstack.c | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/README.txt b/README.txt
index b6a3a3945..13c3b6abe 100644
--- a/README.txt
+++ b/README.txt
@@ -379,7 +379,9 @@ command line.  The remaining 12 belong to the 7 microcode modules and
   missing.o:
 
   obstack.o:
-  00000004 C _obstack
+  00000004 C _obstack			__thread
+
+	OK.  All state is thread-local now.
 
   option.o:
   00000004 B option_band_file
diff --git a/src/microcode/obstack.c b/src/microcode/obstack.c
index 3fe44f748..58e5e43a5 100644
--- a/src/microcode/obstack.c
+++ b/src/microcode/obstack.c
@@ -47,7 +47,7 @@ union fooround {long x; double d;};
 /* The non-GNU-C macros copy the obstack into this global variable
    to avoid multiple evaluation.  */
 
-struct obstack *_obstack;
+__thread struct obstack *_obstack;
 
 /* Initialize an obstack H for use.  Specify chunk size SIZE (0 means default).
    Objects start on multiples of ALIGNMENT (0 means use default).
-- 
2.25.1