Deleted Added
full compact
thr_sig.c (164929) thr_sig.c (173801)
1/*
2 * Copyright (c) 2005, David Xu <davidxu@freebsd.org>
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

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
1/*
2 * Copyright (c) 2005, David Xu <davidxu@freebsd.org>
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

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/lib/libthr/thread/thr_sig.c 164929 2006-12-06 00:15:35Z davidxu $
26 * $FreeBSD: head/lib/libthr/thread/thr_sig.c 173801 2007-11-21 05:21:58Z davidxu $
27 */
28
29#include "namespace.h"
30#include <sys/param.h>
31#include <sys/types.h>
32#include <sys/signalvar.h>
33#include <signal.h>
34#include <errno.h>

--- 15 unchanged lines hidden (view full) ---

50extern int __pause(void);
51int ___pause(void);
52int _raise(int);
53int __sigtimedwait(const sigset_t *set, siginfo_t *info,
54 const struct timespec * timeout);
55int __sigwaitinfo(const sigset_t *set, siginfo_t *info);
56int __sigwait(const sigset_t *set, int *sig);
57
27 */
28
29#include "namespace.h"
30#include <sys/param.h>
31#include <sys/types.h>
32#include <sys/signalvar.h>
33#include <signal.h>
34#include <errno.h>

--- 15 unchanged lines hidden (view full) ---

50extern int __pause(void);
51int ___pause(void);
52int _raise(int);
53int __sigtimedwait(const sigset_t *set, siginfo_t *info,
54 const struct timespec * timeout);
55int __sigwaitinfo(const sigset_t *set, siginfo_t *info);
56int __sigwait(const sigset_t *set, int *sig);
57
58
58static void
59sigcancel_handler(int sig __unused,
60 siginfo_t *info __unused, ucontext_t *ucp __unused)
61{
62 struct pthread *curthread = _get_curthread();
63
64 if (curthread->cancel_defer && curthread->cancel_pending)
65 thr_wake(curthread->tid);

--- 10 unchanged lines hidden (view full) ---

76 == THR_FLAGS_NEED_SUSPEND))
77 _thr_suspend_check(curthread);
78 }
79}
80
81void
82_thr_suspend_check(struct pthread *curthread)
83{
59static void
60sigcancel_handler(int sig __unused,
61 siginfo_t *info __unused, ucontext_t *ucp __unused)
62{
63 struct pthread *curthread = _get_curthread();
64
65 if (curthread->cancel_defer && curthread->cancel_pending)
66 thr_wake(curthread->tid);

--- 10 unchanged lines hidden (view full) ---

77 == THR_FLAGS_NEED_SUSPEND))
78 _thr_suspend_check(curthread);
79 }
80}
81
82void
83_thr_suspend_check(struct pthread *curthread)
84{
84 umtx_t cycle;
85 long cycle;
85 int err;
86
87 err = errno;
88 /*
89 * Blocks SIGCANCEL which other threads must send.
90 */
91 _thr_signal_block(curthread);
92

--- 293 unchanged lines hidden ---
86 int err;
87
88 err = errno;
89 /*
90 * Blocks SIGCANCEL which other threads must send.
91 */
92 _thr_signal_block(curthread);
93

--- 293 unchanged lines hidden ---