[PATCH:intel-gpu-tools 3/6 v2] Use sched_yield instead of pthread_yield

Alan Coopersmith alan.coopersmith at oracle.com
Fri Jan 6 15:45:28 PST 2012


Despite the name implying it's a standard part of the POSIX threads API,
pthread_yield is actually non-standard and less portable than sched_yield.
For instance, Solaris only has sched_yield, and not pthread_yield.
Since even the Linux man page suggests using sched_yield, just call that.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---

v2: Drop autoconfery as suggested by Mark Kettenis, just use sched_yield
    everywhere instead.

 tests/gem_fence_thrash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c
index 8ed4e08..24147de 100644
--- a/tests/gem_fence_thrash.c
+++ b/tests/gem_fence_thrash.c
@@ -110,7 +110,7 @@ bo_copy (void *_arg)
 
 	for (n = 0; n < 1000; n++) {
 		memcpy (a, b, OBJECT_SIZE);
-		pthread_yield ();
+		sched_yield ();
 	}
 
 	return NULL;
-- 
1.7.3.2



More information about the xorg-devel mailing list