Panu Matilainen 70d62a
From b39bd1965ed2fdeadb427648ec7e911613c8398f Mon Sep 17 00:00:00 2001
Panu Matilainen 70d62a
Message-Id: <b39bd1965ed2fdeadb427648ec7e911613c8398f.1561032722.git.pmatilai@redhat.com>
Panu Matilainen 70d62a
From: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen 70d62a
Date: Thu, 20 Jun 2019 15:07:12 +0300
Panu Matilainen 70d62a
Subject: [PATCH] Fix excessive use of thread local storage (RhBug:1722181),
Panu Matilainen 70d62a
 part II
Panu Matilainen 70d62a
Panu Matilainen 70d62a
This essentially reverts commit ff43d03d1f9686c9ffa9232a64e253783309feb5
Panu Matilainen 70d62a
which made these all thread local. It might not be quite right, but then
Panu Matilainen 70d62a
using TLS is not sensible either - threads have their own signal *mask*,
Panu Matilainen 70d62a
but disposition is global, and most of what we do here is global anyway.
Panu Matilainen 70d62a
In addition, the signal queue is only enabled in places where threads
Panu Matilainen 70d62a
are not used (or would not be safe anyhow) so reverting for now seems
Panu Matilainen 70d62a
the lesser evil.
Panu Matilainen 70d62a
---
Panu Matilainen 70d62a
 rpmio/rpmsq.c | 10 +++++-----
Panu Matilainen 70d62a
 1 file changed, 5 insertions(+), 5 deletions(-)
Panu Matilainen 70d62a
Panu Matilainen 70d62a
diff --git a/rpmio/rpmsq.c b/rpmio/rpmsq.c
Panu Matilainen 70d62a
index d157514e9..249a204b3 100644
Panu Matilainen 70d62a
--- a/rpmio/rpmsq.c
Panu Matilainen 70d62a
+++ b/rpmio/rpmsq.c
Panu Matilainen 70d62a
@@ -16,9 +16,9 @@
Panu Matilainen 70d62a
 
Panu Matilainen 70d62a
 #include "debug.h"
Panu Matilainen 70d62a
 
Panu Matilainen 70d62a
-static __thread int disableInterruptSafety;
Panu Matilainen 70d62a
-static __thread sigset_t rpmsqCaught;
Panu Matilainen 70d62a
-static __thread sigset_t rpmsqActive;
Panu Matilainen 70d62a
+static int disableInterruptSafety;
Panu Matilainen 70d62a
+static sigset_t rpmsqCaught;
Panu Matilainen 70d62a
+static sigset_t rpmsqActive;
Panu Matilainen 70d62a
 
Panu Matilainen 70d62a
 typedef struct rpmsig_s * rpmsig;
Panu Matilainen 70d62a
 
Panu Matilainen 70d62a
@@ -171,8 +171,8 @@ int rpmsqPoll(void)
Panu Matilainen 70d62a
 
Panu Matilainen 70d62a
 int rpmsqBlock(int op)
Panu Matilainen 70d62a
 {
Panu Matilainen 70d62a
-    static __thread sigset_t oldMask;
Panu Matilainen 70d62a
-    static __thread int blocked = 0;
Panu Matilainen 70d62a
+    static sigset_t oldMask;
Panu Matilainen 70d62a
+    static int blocked = 0;
Panu Matilainen 70d62a
     sigset_t newMask;
Panu Matilainen 70d62a
     int ret = 0;
Panu Matilainen 70d62a
 
Panu Matilainen 70d62a
-- 
Panu Matilainen 70d62a
2.21.0
Panu Matilainen 70d62a