Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/thread-stub change libc sched_yield() stub to actua...



details:   https://anonhg.NetBSD.org/src/rev/d72eb52561e1
branches:  trunk
changeset: 959241:d72eb52561e1
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Feb 06 00:08:58 2021 +0000

description:
change libc sched_yield() stub to actually still call the syscall
instead of doing nothing when app is not linked with pthread; this matches
other systems

suggested by Mateusz Guzik in:
http://mail-index.netbsd.org/tech-kern/2020/07/19/msg026620.html

diffstat:

 lib/libc/thread-stub/thread-stub.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r d5a54e4feeb0 -r d72eb52561e1 lib/libc/thread-stub/thread-stub.c
--- a/lib/libc/thread-stub/thread-stub.c        Fri Feb 05 22:23:30 2021 +0000
+++ b/lib/libc/thread-stub/thread-stub.c        Sat Feb 06 00:08:58 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: thread-stub.c,v 1.30 2020/01/14 18:18:59 kamil Exp $   */
+/*     $NetBSD: thread-stub.c,v 1.31 2021/02/06 00:08:58 jdolecek Exp $        */
 
 /*-
  * Copyright (c) 2003, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: thread-stub.c,v 1.30 2020/01/14 18:18:59 kamil Exp $");
+__RCSID("$NetBSD: thread-stub.c,v 1.31 2021/02/06 00:08:58 jdolecek Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -394,12 +394,13 @@
        return ((thr_t) -1);
 }
 
+/* This is the strong symbol generated for sched_yield(2) via WSYSCALL() */
+int _sys_sched_yield(void);
+
 int
 __libc_thr_yield_stub(void)
 {
-
-       /* Nothing to do. */
-       return (0);
+       return _sys_sched_yield();
 }
 
 int



Home | Main Index | Thread Index | Old Index