thr_sig.c (479778b07f927a05d592d6114e018604d79a2f9c) thr_sig.c (7d9d7ca2ed3e3d630e63482c41f2d26194129c2c)
1/*
2 * Copyright (c) 2003 Jeffrey Roberson <jeff@freebsd.org>
3 * Copyright (c) 2003 Jonathan Mini <mini@freebsd.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

108 _thread_init();
109 return (thr_kill(pthread->thr_id, sig));
110}
111
112/*
113 * User thread signal handler wrapper.
114 */
115void
1/*
2 * Copyright (c) 2003 Jeffrey Roberson <jeff@freebsd.org>
3 * Copyright (c) 2003 Jonathan Mini <mini@freebsd.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

108 _thread_init();
109 return (thr_kill(pthread->thr_id, sig));
110}
111
112/*
113 * User thread signal handler wrapper.
114 */
115void
116_thread_sig_wrapper(int sig, siginfo_t *info, ucontext_t *context)
116_thread_sig_wrapper(int sig, siginfo_t *info, void *context)
117{
118 struct pthread_state_data psd;
119 __siginfohandler_t *handler;
120
121 GIANT_LOCK(curthread);
122 /* Save the thread's previous state. */
123 psd.psd_wait_data = curthread->data;
124 psd.psd_state = curthread->state;

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

144 default:
145 break;
146 }
147
148 if (_thread_sigact[sig -1].sa_handler != NULL) {
149 GIANT_UNLOCK(curthread);
150 handler = (__siginfohandler_t *)
151 _thread_sigact[sig - 1].sa_handler;
117{
118 struct pthread_state_data psd;
119 __siginfohandler_t *handler;
120
121 GIANT_LOCK(curthread);
122 /* Save the thread's previous state. */
123 psd.psd_wait_data = curthread->data;
124 psd.psd_state = curthread->state;

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

144 default:
145 break;
146 }
147
148 if (_thread_sigact[sig -1].sa_handler != NULL) {
149 GIANT_UNLOCK(curthread);
150 handler = (__siginfohandler_t *)
151 _thread_sigact[sig - 1].sa_handler;
152 handler(sig, info, context);
152 handler(sig, info, (ucontext_t *)context);
153 GIANT_LOCK(curthread);
154 }
155
156 /* Restore the signal frame. */
157 curthread->data = psd.psd_wait_data;
158 curthread->state = psd.psd_state;
159 curthread->flags = psd.psd_flags &
160 (PTHREAD_FLAGS_PRIVATE | PTHREAD_FLAGS_TRACE);
161 GIANT_UNLOCK(curthread);
162}
153 GIANT_LOCK(curthread);
154 }
155
156 /* Restore the signal frame. */
157 curthread->data = psd.psd_wait_data;
158 curthread->state = psd.psd_state;
159 curthread->flags = psd.psd_flags &
160 (PTHREAD_FLAGS_PRIVATE | PTHREAD_FLAGS_TRACE);
161 GIANT_UNLOCK(curthread);
162}