Commit Graph

18 Commits

Author SHA1 Message Date
cl 812a254c5d remove incorrect assert:
regular threads can block in the kernel while holding (libpthread) locks
and have to be continued

XXX if the blocked upcall is preempted, the blocked threads syscall
XXX return value can get lost
2003-10-29 18:53:34 +00:00
yamt 2016949b00 update a comment. 2003-10-24 17:35:22 +00:00
wiz 37ac1db454 available, not avaliable. From miod@openbsd. 2003-09-29 09:50:21 +00:00
cl 5c40d56471 fix SA/pthread pagefault failure:
- prevent BLOCKED upcalls on double page faults and during upcalls
- make libpthread handle blocked threads which hold locks
- prevent UNBLOCKED upcalls from overtaking their BLOCKED upcall
this adds a new syscall sa_unblockyield
see also http://mail-index.netbsd.org/tech-kern/2003/09/15/0020.html
2003-09-16 13:51:31 +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
cl 89d0cfd21f Remove possible race condition in upcall recycling. 2003-09-07 14:47:44 +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
nathanw 81a27fd0b2 Adapt to pt_trapuc: Store context obtained from upcalls there, clear it
in switchto targets and vitims, and print it in debug messages (including
indication of whether a context is trap or user context).

Remove obsolete pt_sleepuc handling.
2003-06-26 01:28:14 +00:00
nathanw 4a9ac109f0 Complain clearly if SA syscalls aren't avaliable. 2003-06-25 23:23:27 +00:00
nathanw b43f1c7405 In pthread__resolve_locks(), change the conditions for removing a normal
thread from the continuation chain: Not only must it have released all
spinlocks, but it must have signaled completion by finishing pthread__switch
or by having stored into pt_switchto.

Together with the previous pthread_switch.S changes, this fixes a couple of
crasehes caused by race conditions in the examination and use of pt_next,
and by switching to empty pt_switchtouc's.
2003-06-12 21:49:42 +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 5faa7f5bef * Recycle upcall stacks as soon as possible rather than waiting to
accumulate half of the total number. There are too many ways for
  the SA subsystem to deadlock waiting for stacks that userland has no
  reason to recycle.

* Consolidate switchto handling in pthread_resolve_locks().

* Add code to re-chain the preempting parents of switchtos.

* Tweak debuglog output in a couple of cases.
2003-05-26 19:41:03 +00:00
lukem f043c0fb57 add __RCSID() 2003-03-08 08:03:34 +00:00
nathanw 53827081be Adapt to pthread__assert() and remove local debug toggle. 2003-02-15 04:37:04 +00:00
nathanw a8773f45f8 Simplify pthread__upcall() a bit by moving lock resolution before the big
switch statement, and moving upcall-type-specific code into that switch.
Beneficial side effect: don't manipulate a statelock before lock resolution
occurs.
2003-01-30 01:04:50 +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
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