Commit Graph

22 Commits

Author SHA1 Message Date
yamt 5cd18e71cc in pthread__deliver_signal(),
copy siginfo_t into the stack of the target thread
rather than relying on the luck that on-stack siginfo_t stay valid.
2003-10-16 13:38:28 +00:00
christos 86d645082f fix syntax; thanks aymeric 2003-09-13 17:19:55 +00:00
christos d1bb4290e8 explicitly use a sigset_t * variable to recover the signal mask pointer. 2003-09-13 15:26:38 +00:00
drochner 45a9abb6af make it compile with PTHREAD_SIG_DEBUG again 2003-09-12 15:31:00 +00:00
kleink 8742dcef75 Fix pasto in previous. 2003-09-12 10:10:39 +00:00
christos 138df80b74 convert to use siginfo/ucontext style of signal delivery instead of
sigcontext. Approved by nathanw.
2003-09-12 00:37:17 +00:00
nathanw e1fb9dd8e8 In pthread__deliver_signal(), correctly use pt_trapuc or pt_uc as the
context-to-restore instead of always using pt_uc.

Fixes a problem with signal handlers for synchronous signals noted by
Matthias Drochner on current-users.
2003-08-22 17:35:52 +00:00
nathanw 0878df5d25 Lock accesses to pt_flags and pt_cancel.
When disabling cancellation, clear the pt_cancel flag if it was set
and note the cancellation request with PT_FLAG_CS_PENDING. This avoids
a problem where a cancellation request entered but not acted upon before
pthread_setcanclstate(PTHREAD_CANCEL_DISABLE) is called would still be
aceted upon before cancellation was re-enabled.
2003-07-21 22:24:09 +00:00
fvdl 2949ab0051 Take the normal return path in sigtimedwait when the current thread was
canceled as well. From Stephan Uphoff.
2003-07-17 18:15:21 +00:00
christos 143f5a277a pass lint:
1. add new pthread__abort() and change pthread_assert(0) to it.
2. put constcond in the right place (in the macro).
3. no space after pthread__assert macro.
2003-05-27 15:24:24 +00:00
nathanw a0628261fe Use pthread__assert() instead of plain assert(), as the latter has
locking issues.
2003-03-20 01:03:52 +00:00
nathanw a25b9285d9 Add a wrapper for the execve() system call that arranges for the current
thread sigal mask to be propagated into the new process image.
2003-03-14 22:27:34 +00:00
lukem f043c0fb57 add __RCSID() 2003-03-08 08:03:34 +00:00
lha c2d825cbda If pthreads hasn't started yet when calling sigsuspend, use the systemcall 2003-02-28 17:30:07 +00:00
jdolecek e6781abf3f interposition sigtimedwait() with a thread-aware version, which uses
single proxy thread to do the actual syscall, and blocks other threads
in userland
2003-02-15 21:18:59 +00:00
nathanw 6adb81d685 Move debug toggle to pthread_debug.h. 2003-02-15 04:38:58 +00:00
nathanw f66d2f37f7 More rototilling:
* Implement pthread_kill().

  * Return the old thread mask, not the old process mask, in our
    interpositioned sigaction call.

  * Refer to _NSIG, not NSIG.

  * Gut pthread_sigmask(). It was handling a lot of corner cases that
    weren't legal anyway. Handle unblocked signals with a new
    pthread__kill_self() routine (also used by pthread_kill()).

  * Be more consistent with locking around pt_sigacts[].
2003-01-30 01:12:42 +00:00
jdolecek 5e8bddc2e7 __sigaction14(): sanity check 'sig' before use, same way as sigaction1()
in kernel
2003-01-28 21:04:37 +00:00
nathanw fe8e8dad4a More signal rearranging:
- Signal handlers now simply continue executing the current thread,
   rather than trying to put themselves back on the queue that they came
   from, which was rather fragile. As a result, all callers of
   pthread__block() must be prepared to handle spurious wakeups.

 - When a signal arrives for a thread that is blocked in the kernel,
   note this in another field in pthread_st and set a flag. Process the
   signal and set up the trampoline for the handler *after* the thread
   unblocks, so that both the trampoline and the returned state from
   the kernel are preserved.

 - Factor out some code into a pthread__deliver_signal() routine;
   the signal-taking code in pthread_sigmask() should be able to use this
   soon.

This is still gross, and there are still some terrible MP issues lurking here,
but progress crawls along.
2003-01-25 00:43:38 +00:00
jdolecek 254ff213ae unlock pt_statelock _after_ changing pt_state, not before
problem found and fix suggested by Nick Hudson
2003-01-24 17:43:45 +00:00
christos 9631ace572 de-lint 2003-01-18 18:40:52 +00:00
thorpej c62a74e6d5 Merge the nathanw_sa branch. 2003-01-18 10:32:11 +00:00