summaryrefslogtreecommitdiff
path: root/libgcompat/pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgcompat/pthread.c')
-rw-r--r--libgcompat/pthread.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libgcompat/pthread.c b/libgcompat/pthread.c
index f15e9f1..4357d74 100644
--- a/libgcompat/pthread.c
+++ b/libgcompat/pthread.c
@@ -2,6 +2,7 @@
#include <errno.h> /* errno */
#include <fcntl.h> /* O_CLOEXEC, O_RDONLY */
#include <pthread.h> /* pthread_atfork */
+#include <sched.h> /* sched_yield */
#include <unistd.h> /* open, read */
#include "alias.h" /* weak_alias */
@@ -52,3 +53,11 @@ int pthread_getname_np(pthread_t thread, char *name, size_t len)
return 0;
}
+
+/**
+ * Yield this thread.
+ */
+int pthread_yield(void)
+{
+ return sched_yield();
+}