thr_sigsuspend.c (117706) | thr_sigsuspend.c (119063) |
---|---|
1/* 2 * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. 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) 1995 John Birrell <jb@cimlogic.com.au>. 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_sigsuspend.c 117706 2003-07-17 23:02:30Z davidxu $ | 32 * $FreeBSD: head/lib/libkse/thread/thr_sigsuspend.c 119063 2003-08-18 03:58:29Z davidxu $ |
33 */ 34#include <signal.h> 35#include <errno.h> 36#include <pthread.h> 37#include <string.h> 38#include <sys/signalvar.h> 39#include "thr_private.h" 40 41__weak_reference(__sigsuspend, sigsuspend); 42 43int 44_sigsuspend(const sigset_t *set) 45{ 46 struct pthread *curthread = _get_curthread(); 47 sigset_t oldmask, newmask; 48 int ret = -1; 49 | 33 */ 34#include <signal.h> 35#include <errno.h> 36#include <pthread.h> 37#include <string.h> 38#include <sys/signalvar.h> 39#include "thr_private.h" 40 41__weak_reference(__sigsuspend, sigsuspend); 42 43int 44_sigsuspend(const sigset_t *set) 45{ 46 struct pthread *curthread = _get_curthread(); 47 sigset_t oldmask, newmask; 48 int ret = -1; 49 |
50 if (!_kse_isthreaded() || 51 (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM)) | 50 if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) |
52 return (__sys_sigsuspend(set)); 53 54 /* Check if a new signal set was provided by the caller: */ 55 if (set != NULL) { 56 newmask = *set; 57 SIG_CANTMASK(newmask); 58 59 THR_LOCK_SWITCH(curthread); --- 45 unchanged lines hidden --- | 51 return (__sys_sigsuspend(set)); 52 53 /* Check if a new signal set was provided by the caller: */ 54 if (set != NULL) { 55 newmask = *set; 56 SIG_CANTMASK(newmask); 57 58 THR_LOCK_SWITCH(curthread); --- 45 unchanged lines hidden --- |