diff options
| author | Jason Evans <jasone@FreeBSD.org> | 2000-01-19 07:04:50 +0000 |
|---|---|---|
| committer | Jason Evans <jasone@FreeBSD.org> | 2000-01-19 07:04:50 +0000 |
| commit | 0a3fa43c7e06dfbd6ddde4767d9c8a0c6a2ad51f (patch) | |
| tree | d60f837da3362893d30d022990c52c439190405b /lib/libpthread/thread/thr_kern.c | |
| parent | 1c12990b99e0a50adad4fb4691b64378de2f1b12 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_kern.c')
| -rw-r--r-- | lib/libpthread/thread/thr_kern.c | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index b3fbc3ac3434..b83306157fc9 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -122,6 +122,17 @@ __asm__("fnsave %0": :"m"(*fdata)); pthread_testcancel(); } +#ifndef _NO_UNDISPATCH + /* + * Check for undispatched signals due to calls to + * pthread_kill(). + */ + if (_thread_run->undispatched_signals != 0) { + _thread_run->undispatched_signals = 0; + _dispatch_signals(); + } +#endif + if (_sched_switch_hook != NULL) { /* Run the installed switch hook: */ thread_run_switch_hook(_last_user_thread, _thread_run); @@ -365,8 +376,7 @@ __asm__("fnsave %0": :"m"(*fdata)); * something happens that changes this condition: */ _thread_kern_poll(1); - } - else { + } else { /* Remove the thread from the ready queue: */ PTHREAD_PRIOQ_REMOVE(pthread_h); @@ -537,8 +547,38 @@ __asm__("fnsave %0": :"m"(*fdata)); } } + /* + * Check if this thread is being continued from a + * longjmp() out of a signal handler: + */ + if ((_thread_run->jmpflags & JMPFLAGS_LONGJMP) != 0) { + _thread_run->jmpflags = 0; + __longjmp(_thread_run->nested_jmp.jmp, + _thread_run->longjmp_val); + } + /* + * Check if this thread is being continued from a + * _longjmp() out of a signal handler: + */ + else if ((_thread_run->jmpflags & JMPFLAGS__LONGJMP) != + 0) { + _thread_run->jmpflags = 0; + ___longjmp(_thread_run->nested_jmp.jmp, + _thread_run->longjmp_val); + } + /* + * Check if this thread is being continued from a + * siglongjmp() out of a signal handler: + */ + else if ((_thread_run->jmpflags & JMPFLAGS_SIGLONGJMP) + != 0) { + _thread_run->jmpflags = 0; + __siglongjmp( + _thread_run->nested_jmp.sigjmp, + _thread_run->longjmp_val); + } /* Check if a signal context was saved: */ - if (_thread_run->sig_saved == 1) { + else if (_thread_run->sig_saved == 1) { #ifndef __alpha__ /* * Point to the floating point data in the @@ -571,7 +611,7 @@ __asm__("fnsave %0": :"m"(*fdata)); * was context switched out (by a longjmp to * a different thread): */ - longjmp(_thread_run->saved_jmp_buf, 1); + __longjmp(_thread_run->saved_jmp_buf, 1); } /* This point should not be reached. */ |
