summaryrefslogtreecommitdiff
blob: e11b1148bb89025b71add6f2143856a76815d21d (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
From 5f4c1c01de8f0da24956c1c931d3ffe7410b5b78 Mon Sep 17 00:00:00 2001
From: David Seifert <soap@gentoo.org>
Date: Sat, 30 Oct 2021 18:35:53 +0200
Subject: [PATCH] pthread_yield -> sched_yield (glibc 2.34)

Bug: https://bugs.gentoo.org/808049
Upstream: https://github.com/ROCm-Developer-Tools/roctracer/pull/63
---
 src/core/memory_pool.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/core/memory_pool.h b/src/core/memory_pool.h
index fe2f1a6..fbd9060 100644
--- a/src/core/memory_pool.h
+++ b/src/core/memory_pool.h
@@ -24,6 +24,7 @@ THE SOFTWARE.
 #define MEMORY_POOL_H_
 
 #include <pthread.h>
+#include <sched.h>
 #include <stdlib.h>
 
 #include <atomic>
@@ -152,7 +153,7 @@ class MemoryPool {
   }
 
   static void sync_reader(const consumer_arg_t* arg) {
-    while(arg->valid.load() == true) PTHREAD_CALL(pthread_yield());
+    while(arg->valid.load() == true) PTHREAD_CALL(sched_yield());
   }
 
   static void* reader_fun(void* consumer_arg) {
-- 
2.33.1