about summary refs log tree commit diff
path: root/nptl/pthread_yield.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-05-03 09:23:17 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-05-03 09:23:44 +0200
commitc2fd60a5861efef48252f5cc7efc70e1d8a0da9a (patch)
tree73039b111fb8f291dfcd4cc91b9f037f82ceda93 /nptl/pthread_yield.c
parent0505ae4e3b6d18b7ed1ec4c9b2d7e890acadec93 (diff)
downloadglibc-c2fd60a5861efef48252f5cc7efc70e1d8a0da9a.tar.gz
glibc-c2fd60a5861efef48252f5cc7efc70e1d8a0da9a.tar.xz
glibc-c2fd60a5861efef48252f5cc7efc70e1d8a0da9a.zip
nptl: Move pthread_yield into libc, as a compatibility symbol
And deprecate it in <pthread.h>, redirecting it to sched_yield
for the time being.

The symbol was moved using scripts/move-symbol-to-libc.py.

No GLIBC_2.34 symbol version is added because of the compatibility
symbol status.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'nptl/pthread_yield.c')
-rw-r--r--nptl/pthread_yield.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/nptl/pthread_yield.c b/nptl/pthread_yield.c
index b9eecd578d..638d6a3e68 100644
--- a/nptl/pthread_yield.c
+++ b/nptl/pthread_yield.c
@@ -18,12 +18,13 @@
 
 #include <pthread.h>
 #include <sched.h>
+#include <shlib-compat.h>
 
-
-/* With the 1-on-1 model we implement this function is equivalent to
-   the 'sched_yield' function.  */
-int
-pthread_yield (void)
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34)
+int attribute_compat_text_section
+__pthread_yield (void)
 {
-  return sched_yield ();
+  return __sched_yield ();
 }
+compat_symbol (libpthread, __pthread_yield, pthread_yield, GLIBC_2_2);
+#endif /* OTHER_SHLIB_COMPAT */