After exiting the try-again loop, make one more test of the lock
conditions, in case it was released while a signal handler kept the
thread busy past the alarm expiration.
blockgen!=unblockgen. I'm not sure this is 100% correct, but it partly
alleviates a problem with multiple unblocks for the same thread getting
stacked up.
a timer, as that will clear the timer instead. Pass in a safely in-the-past
value instead.
Addresses PR lib/28700.
(XXX passing in values between 0 and 1000 nanoseconds will still fail, but
that bug needs to be fixed in timer_settime(), not here)
scheduling stuff: only handle SCHED_OTHER. Like the rest of the scheduling
stuff, this is for the benefit of code that can't be bothered to test against
_POSIX_THREAD_PRIORITY_SCHEDULING.
pthread_cond_timedwait().
XXX as noted in the comments, in the situations where these are
useful, they should never be called in a single-threaded
process. Perhaps they should die rather than return 0.
Addresses xsrc/28630.
to be transformed into the do-nothing-when-libpthread-isn't-linked libc
stub names. This will permit library code that uses <pthread.h> and pthread
functions "defensively" to not need to link against libpthread and not need
to be patched to the threadlib.h API.
is set, so that the single-step trap happens in the thread's context
and not in the middle of _setcontext_u.
XXX might be able to do something here with iret, too, but it needs
more testing.
namely, put the thread to deadqueue rather than just leaking it.
- fix a race between pthread_detach/join and pthread_exit,
which also causes dead thread leaks.
waiters list in all cases, not just on cancellation; there are other
sources of spurious wakeups, such as single-stepping in the debugger.
regress/lib/libpthread/conddestroy1 now passes.
- statically initialize all global spin locks. on hppa, 0 means
the lock is held, so leaving them with the default value doesn't work.
- compare functions pointers using a function-pointer type rather than
an integral type. on hppa, function pointers may be indirect,
so we need to trigger gcc to emit calls to the function-pointer
canonicalization routines in the millicode.
- on hppa the stack grows up, so handle that using the STACK_* macros.
sleep(3) expects this, even though it's not a documented property of
nanosleep().
Fixes a problem where sleep() in a threaded program would return
nonzero even on success.