diff options
-rw-r--r-- | CHANGELOG.rst | 9 | ||||
-rw-r--r-- | libgcompat/pthread.c | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f3bd158..a430e05 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,15 @@ © 2016-2019 Adélie Linux and contributors. NCSA open source licence. +0.9.1 (2020-08-??) +================== + +pthread +------- + +* Add pthread_yield from Hal G. + + 0.9.0 (2020-07-06) ================== 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(); +} |