| Age | Commit message (Collapse) | Author |
|
mutex thread, thus leaving a thread sleeping on an unlocked mutex.
Reviewed by myself and Christos.
Problem reported by Arne H. Juul, arnej at pvv dot ntnu dot no,
in PR 26208. This fix represents option 1 presented in the PR.
|
|
referenced from C code.
|
|
Encapsulate previously copied code sections into macros.
|
|
|
|
forget to clear it out of pt_siglist, otherwise we will keep getting
it over and over again. fixes a problem introduced in rev 1.43.
problem observed with mysqld where sending it a SIGHUP after it has
set an alarm (e.g. due to some package like rt3 using it) caused the
signal handler thread to go into a tight loop (collecting a SIGALRM
[via sigwait() in mysqld.cc] that would not go away due to the above
issue). mysqld appears to get a SIGHUP when /etc/rc exits, so it
can go into this tight loop after a reboot (but not if you restart
it by hand). the bad sequence is:
/etc/rc runs:
- starts mysqld
- starts web server with rt3 fastcgi starts
- fastcgi/rt3 talks to mysqld (causing it to set an alarm)
- /etc/rc exits, SIGHUP goes to mysqld
- mysqld catches SIGHUP, signal handler thread gets
stuck in loop (database continues to operate, slowly).
you can also trigger the problem by sending mysqld a SIGHUP by hand after
you've caused it to set an alarm by connecting to it.
|
|
|
|
the process' signal mask -- this ends up in a no-op.
Use the system call directly instead.
(This might be done in pthread_sig.c, but for now I wanted a simple
patch which is easily tested and pulled up.)
|
|
current context. Valid values can change depending on how the kernel is
setup. i386 and amd64 happen to be setup differently.
|
|
|
|
so that the main thread is not different from others.
as a side effect, fix memory leak in pthread_create on error.
- make pthread__stackid_setup return a error rather than calling err(2).
|
|
locked_return_point change.
Loading the instruction at locked_return_point as a return value didn't
work so well.
Thanks to uwe, cube, and dsl.
|
|
|
|
|
|
shared library.
|
|
locations:
- Don't declare pthread__switch_away global
- Do the PIC dance for pthread__switch_return_point and
pthread__locked_switch. Ideally these (and other) symbols would
be hidden.
Thanks to uwe@, dyoung@ and elad@ for help.
XXX sh3 is still to be done.
XXX vax does strange things.
|
|
code is generated (still with text relocs, but eliminating them is the
next step).
|
|
|
|
|
|
in pthread and one in libc.
|
|
failing an assertion.
|
|
any threads are created turned out to be not such a good idea.
there are stronger requirements on what has to work in a forked child
while a process is still single-threaded. so take all that stuff
back out and fix the problems with single-threaded programs that
are linked with libpthread differently, by checking if the library
has been started and doing completely different stuff if it hasn't been:
- for pthread_rwlock_timedrdlock(), just fail with EDEADLK immediately.
- for sem_wait(), the only thing that can unlock the semaphore is a
signal handler, so use sigsuspend() to wait for a signal.
- for pthread_mutex_lock_slow(), just go into an infinite loop
waiting for signals.
I also noticed that there's a "sem2" test that has never worked in its
single-threaded form. the problem there is that a signal handler tries
to take a sem_t interlock which is already held when the signal is received.
fix this too, by adding a single-threaded case for sig_trywait() that
blocks signals instead of using the userland interlock.
|
|
if the target thread is a zombie.
in all the functions that didn't do so already, verify a pthread_t before
dereferencing it (under #ifdef ERRORCHECK, since these checks are not
mandated by the standard).
clean up some debugging stuff.
|
|
both waking up a sleeping thread and avoiding going to sleep if
a signal is already pending. fixes PR 30348.
|
|
call pthread__start() if it hasn't already been called. this avoids
an internal assertion from the library if these routines are used
before any threads are created and they need to sleep.
fixes PR 20256, PR 24241, PR 25722, PR 26096.
|
|
(per the standard) instead of returning ENOSYS. Noted by Ian Zagorskih
in PR kern/30970.
|
|
SCHED_OTHER happens to be 0, so this assignment to "int *" succeeds,
and becomes a no-op.
Fix by dereferencing "policy" to do the assignment, thus filling the
return buffer with 0.
|
|
|
|
Thanks martin...
|
|
- unblock the signal we are currently delivering, because it might have
been blocked if we are woken up by another thread.
|
|
the once routine is cancelled, the effect on once_control is as if
pthread_once() was never called.
Bug report and fix from PR lib/30734.
|
|
|
|
and pthread_attr_getschedparam.3 to pthread_attr.3.
From Igor Sobrado in PR/29997.
|
|
|
|
Break much too long line.
|
|
pthread_barierattr_destroy.3 but to pthread_barrierattr_init.3
and pthread_barrierattr_destroy.3 (note the 2 rs in barrier).
|
|
From Igor Sobrado in PR/29997.
|
|
|
|
the current time plus the caller-supplied time to sleep wraps the
time_t. Instead, sleep until INT_MAX.
|
|
|
|
|
|
|
|
|
|
to do it.
|
|
to libc.so.12.127 and libpthread.so.0.6.
|
|
|
|
<sys/sigtypes.h> this is needed earlier.
|
|
the signal mask experienced by signal handlers in threaded programs.
Fixes regress/lib/libpthread/sigmask3.
|
|
threads are started, since before that the traditional signal invocation
method will be used. Fixes regress/lib/libpthread/sigmask2.
|
|
setting a new signal action; this makes sigaction(sig, NULL, &oact)
return a sensible value in the signal mask instead of stack trash.
Addresses PR lib/29536.
XXX the mask seen by signal handlers in a program linked with
libpthread but not yet multithreaded will not reflect masks set here.
|
|
related to pthread_kill().
|