Source-Changes-HG archive

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

[src/trunk]: src/lib/libpthread If pthreads hasn't started yet when calling s...



details:   https://anonhg.NetBSD.org/src/rev/e2164fb53ef0
branches:  trunk
changeset: 543593:e2164fb53ef0
user:      lha <lha%NetBSD.org@localhost>
date:      Fri Feb 28 17:30:07 2003 +0000

description:
If pthreads hasn't started yet when calling sigsuspend, use the systemcall

diffstat:

 lib/libpthread/pthread_sig.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r fae9df7c53b6 -r e2164fb53ef0 lib/libpthread/pthread_sig.c
--- a/lib/libpthread/pthread_sig.c      Fri Feb 28 12:37:04 2003 +0000
+++ b/lib/libpthread/pthread_sig.c      Fri Feb 28 17:30:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_sig.c,v 1.9 2003/02/15 21:19:00 jdolecek Exp $ */
+/*     $NetBSD: pthread_sig.c,v 1.10 2003/02/28 17:30:07 lha Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -63,6 +63,8 @@
 #define SDPRINTF(x)
 #endif
 
+extern int pthread__started;
+
 extern pthread_spin_t pthread__runqueue_lock;
 extern struct pthread_queue_t pthread__runqueue;
 
@@ -198,12 +200,18 @@
        return retval;
 }
 
+int _sys___sigsuspend14(const sigset_t *);
+
 int
 __sigsuspend14(const sigset_t *sigmask)
 {
        pthread_t self;
        sigset_t oldmask;
 
+       /* if threading not started yet, just do the syscall */
+       if (__predict_false(pthread__started == 0))
+               return (_sys___sigsuspend14(sigmask));
+
        self = pthread__self();
 
        pthread_spinlock(self, &pt_sigsuspended_lock);
@@ -252,7 +260,6 @@
        int error = 0;
        pthread_t target;
        sigset_t wset;
-       extern int pthread__started;
        struct timespec timo;
 
        /* if threading not started yet, just do the syscall */



Home | Main Index | Thread Index | Old Index