summaryrefslogtreecommitdiff
path: root/libgcompat
diff options
context:
space:
mode:
authorHal G <systemdlete@fastmail.com>2020-08-18 15:36:15 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-08-18 15:38:02 -0500
commitaa649428f2d294c03b50b0bc9e11b51296bab008 (patch)
tree0ddd0e14614c7c0b814573fdd2d92db1026f0414 /libgcompat
parent2d7599351787c5c9db78560923ed226e29ebe02f (diff)
downloadgcompat-aa649428f2d294c03b50b0bc9e11b51296bab008.tar.gz
gcompat-aa649428f2d294c03b50b0bc9e11b51296bab008.tar.bz2
gcompat-aa649428f2d294c03b50b0bc9e11b51296bab008.tar.xz
gcompat-aa649428f2d294c03b50b0bc9e11b51296bab008.zip
pthread: Add pthread_yield()
Calls the more standard sched_yield().
Diffstat (limited to 'libgcompat')
-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();
+}