thr_sigpending.c (117300) | thr_sigpending.c (117706) |
---|---|
1/* 2 * Copyright (c) 1999 Daniel Eischen <eischen@vigrid.com>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1999 Daniel Eischen <eischen@vigrid.com>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/lib/libkse/thread/thr_sigpending.c 117300 2003-07-07 04:28:23Z davidxu $ | 32 * $FreeBSD: head/lib/libkse/thread/thr_sigpending.c 117706 2003-07-17 23:02:30Z davidxu $ |
33 */ 34#include <sys/param.h> 35#include <sys/types.h> 36#include <sys/signalvar.h> 37#include <signal.h> 38#include <errno.h> 39#include <pthread.h> 40#include "thr_private.h" --- 9 unchanged lines hidden (view full) --- 50 int ret = 0; 51 52 /* Check for a null signal set pointer: */ 53 if (set == NULL) { 54 /* Return an invalid argument: */ 55 ret = EINVAL; 56 } 57 else { | 33 */ 34#include <sys/param.h> 35#include <sys/types.h> 36#include <sys/signalvar.h> 37#include <signal.h> 38#include <errno.h> 39#include <pthread.h> 40#include "thr_private.h" --- 9 unchanged lines hidden (view full) --- 50 int ret = 0; 51 52 /* Check for a null signal set pointer: */ 53 if (set == NULL) { 54 /* Return an invalid argument: */ 55 ret = EINVAL; 56 } 57 else { |
58 if (!_kse_isthreaded()) 59 return __sys_sigpending(set); | 58 if (!_kse_isthreaded() || 59 (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM)) 60 return (__sys_sigpending(set)); |
60 61 crit = _kse_critical_enter(); 62 KSE_SCHED_LOCK(curthread->kse, curthread->kseg); 63 sigset = curthread->sigpend; 64 KSE_SCHED_UNLOCK(curthread->kse, curthread->kseg); 65 KSE_LOCK_ACQUIRE(curthread->kse, &_thread_signal_lock); 66 SIGSETOR(sigset, _thr_proc_sigpending); 67 KSE_LOCK_RELEASE(curthread->kse, &_thread_signal_lock); 68 _kse_critical_leave(crit); 69 *set = sigset; 70 } 71 /* Return the completion status: */ 72 return (ret); 73} | 61 62 crit = _kse_critical_enter(); 63 KSE_SCHED_LOCK(curthread->kse, curthread->kseg); 64 sigset = curthread->sigpend; 65 KSE_SCHED_UNLOCK(curthread->kse, curthread->kseg); 66 KSE_LOCK_ACQUIRE(curthread->kse, &_thread_signal_lock); 67 SIGSETOR(sigset, _thr_proc_sigpending); 68 KSE_LOCK_RELEASE(curthread->kse, &_thread_signal_lock); 69 _kse_critical_leave(crit); 70 *set = sigset; 71 } 72 /* Return the completion status: */ 73 return (ret); 74} |