[igt-dev] [PATCH i-g-t 2/4] tests/drm_read: pthread_yield -> sched_yield

Ryszard Knop ryszard.knop at intel.com
Thu Jun 2 08:22:22 UTC 2022


pthread_yield is deprecated, use the standard sched_yield instead.

Signed-off-by: Ryszard Knop <ryszard.knop at intel.com>
---
 tests/drm_read.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/drm_read.c b/tests/drm_read.c
index 3186e609..250806d2 100644
--- a/tests/drm_read.c
+++ b/tests/drm_read.c
@@ -44,6 +44,7 @@
 #include <sys/time.h>
 #include <sys/poll.h>
 #include <pthread.h>
+#include <sched.h>
 #include "drm.h"
 
 IGT_TEST_DESCRIPTION("Call read(drm) and see if it behaves.");
@@ -221,7 +222,7 @@ static void test_short_buffer_wakeup(int in, enum pipe pipe)
 		pthread_mutex_unlock(&w.mutex);
 
 		/* Give each thread a chance to sleep in drm_read() */
-		pthread_yield();
+		sched_yield();
 
 		/* One event should wake all threads as none consume */
 		generate_event(w.fd, pipe);
-- 
2.36.1



More information about the igt-dev mailing list