From aa649428f2d294c03b50b0bc9e11b51296bab008 Mon Sep 17 00:00:00 2001 From: Hal G Date: Tue, 18 Aug 2020 15:36:15 -0500 Subject: pthread: Add pthread_yield() Calls the more standard sched_yield(). --- CHANGELOG.rst | 9 +++++++++ libgcompat/pthread.c | 9 +++++++++ 2 files changed, 18 insertions(+) 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 */ #include /* O_CLOEXEC, O_RDONLY */ #include /* pthread_atfork */ +#include /* sched_yield */ #include /* 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(); +} -- cgit v1.2.3-70-g09d2