summaryrefslogtreecommitdiff
path: root/debian/patches/introspection0010-fixup_libintrospection.patch
blob: 079dc97199469f4f294bbb39ff2f07ab7caf8d30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 5a3d6f037c2a78f30b6098060ce73b8f6a7bc41a Mon Sep 17 00:00:00 2001
From: Justus Winter <4winter@informatik.uni-hamburg.de>
Date: Thu, 24 Sep 2015 22:11:58 +0200
Subject: [PATCH hurd 10/12] fixup_libintrospection

---
 libintrospection/trace.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libintrospection/trace.c b/libintrospection/trace.c
index ac2fdb0..392eb3a 100644
--- a/libintrospection/trace.c
+++ b/libintrospection/trace.c
@@ -131,18 +131,12 @@ introspection_trace_message (mach_port_t trace_port,
 static mach_port_t
 make_id (void)
 {
-  static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
   static mach_port_t id;
   mach_port_t result;
 
-  pthread_mutex_lock (&lock);
-
   do
-    id += 1;
-  while (! MACH_PORT_VALID (id));
-
-  result = id;
-  pthread_mutex_unlock (&lock);
+    result = __atomic_add_fetch (&id, 1, __ATOMIC_RELAXED);
+  while (! MACH_PORT_VALID (result));
 
   return result;
 }
-- 
2.1.4