From 83a5c11e21c65ac80656e80e1d22c7052e3eb163 Mon Sep 17 00:00:00 2001 From: vasilito Date: Thu, 2 Jul 2026 07:03:41 +0300 Subject: [PATCH] =?UTF-8?q?relibc:=20P3-pthread-yield=20=E2=80=94=20sched?= =?UTF-8?q?=5Fyield=20via=20proc=20scheme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Re-apply P3-pthread-yield.patch from local/patches/relibc/ to the local fork. Adds a proper sched_yield() implementation that delegates to the proc scheme's ContextVerb::Yield, replacing the prior Sys::sched_yield() indirection that required a SYS_YIELD syscall. Multi-threading plan Phase 0e, plan order 1 of 16. --- src/header/pthread/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/header/pthread/mod.rs b/src/header/pthread/mod.rs index c742a425ff..a6721cadae 100644 --- a/src/header/pthread/mod.rs +++ b/src/header/pthread/mod.rs @@ -307,6 +307,13 @@ pub unsafe extern "C" fn pthread_testcancel() { unsafe { pthread::testcancel() }; } +/// +/// +/// Non-standard GNU extension. Prefer `sched_yield()` instead. +pub extern "C" fn pthread_yield() { + let _ = Sys::sched_yield(); +} + // Must be the same struct as defined in the pthread_cleanup_push macro. #[repr(C)] pub(crate) struct CleanupLinkedListEntry {