Source-Changes-HG archive

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

[src/nathanw_sa]: src/lib/libpthread In pthread_sigmask(), be careful to only...



details:   https://anonhg.NetBSD.org/src/rev/54a2c187cc3d
branches:  nathanw_sa
changeset: 506426:54a2c187cc3d
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Sat Nov 02 00:28:16 2002 +0000

description:
In pthread_sigmask(), be careful to only unlock the spinlocks that
were locked.

diffstat:

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

diffs (23 lines):

diff -r d881a4bd5e5a -r 54a2c187cc3d lib/libpthread/pthread_sig.c
--- a/lib/libpthread/pthread_sig.c      Fri Nov 01 23:04:38 2002 +0000
+++ b/lib/libpthread/pthread_sig.c      Sat Nov 02 00:28:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_sig.c,v 1.1.2.19 2002/10/27 23:35:01 thorpej Exp $     */
+/*     $NetBSD: pthread_sig.c,v 1.1.2.20 2002/11/02 00:28:16 nathanw Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -318,8 +318,11 @@
                        __sigprocmask14(SIG_SETMASK, &pt_process_sigmask, NULL);
                }
        } 
-       pthread_spinunlock(self, &pt_process_siglock);
-       pthread_spinunlock(self, &self->pt_siglock);
+       if (set != NULL) {
+               if ((how == SIG_UNBLOCK) || (how == SIG_SETMASK))
+                       pthread_spinunlock(self, &pt_process_siglock);
+               pthread_spinunlock(self, &self->pt_siglock);
+       }
 
        /*
         * While other threads may read a process's sigmask,



Home | Main Index | Thread Index | Old Index