summaryrefslogtreecommitdiff
path: root/lib/libpthread
AgeCommit message (Collapse)Author
2006-08-22Close a window in which we can not notice a recently-slept-on-ourwrstuden
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.
2006-07-09Err, restore the name of pthread__switch_return_point, it isross
referenced from C code.
2006-07-08Revise for LP64.ross
Encapsulate previously copied code sections into macros.
2006-07-08remove unreferenced temporary labelross
2006-06-12sigtimedwait: if we collect a queued signal via pt_siglist, do notchuck
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.
2006-04-24It's "its."snj
2006-04-24There is no point in using the internal sigprocmask() to initializedrochner
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.)
2006-03-29Instead of using hard-coded values for various registers, get them from thecube
current context. Valid values can change depending on how the kernel is setup. i386 and amd64 happen to be setup differently.
2006-03-19Coverity CID 882: Avoid NULL deref.christos
2006-02-12- do PTHREAD_MLOCK_KLUDGE in pthread__stackid_setup, rather than callers,yamt
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).
2006-01-09I was a bit over zealous with my last change so revert theskrll
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.
2006-01-07pthread_sigmask(): Add restrict qualifier to set, oset args.kleink
2006-01-06Use PLT for PIC calls to avoid text relocs in the shared library.uwe
2006-01-04In PIC code call setcontext(2) via PLT to avoid text reloc in theuwe
shared library.
2006-01-04A couple of fixes to make libpthread really shared, i.e. not have text re-skrll
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.
2005-12-31Adapt to new PIC macros that are now in <machine/asm.h>. Same binaryuwe
code is generated (still with text relocs, but eliminating them is the next step).
2005-12-24__asm__ -> __asmperry
2005-12-24Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.perry
2005-12-13include libc after our own files to fix ports that have 2 assym.h's. Onechristos
in pthread and one in libc.
2005-10-19if mlock() fails in pthread_create(), return EAGAIN instead ofchs
failing an assertion.
2005-10-19starting the pthread library (ie. calling pthread__start()) beforechs
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.
2005-10-16in pthread_kill() and pthread_suspend_np(), return without doing anythingchs
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.
2005-10-16fix the interaction between sigtimedwait() and pthread_kill(),chs
both waking up a sleeping thread and avoiding going to sleep if a signal is already pending. fixes PR 30348.
2005-10-16in pthread_mutex_lock_slow(), pthread_rwlock_timedrdlock() and sem_wait(),chs
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.
2005-10-09Change the sched_*() functions to return -1 and set errno to ENOSYSkleink
(per the standard) instead of returning ENOSYS. Noted by Ian Zagorskih in PR kern/30970.
2005-09-21pthread_attr_getschedpolicy() wasn't setting the return buffer at all.tv
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.
2005-09-13XXX: Work around libpthread's "intimate" connection with libc.christos
2005-07-26Revert part of previous; we need to merge acts.sa_mask into our pthread mask.christos
Thanks martin...
2005-07-26- removed bogus acts.sa_mask setting.christos
- unblock the signal we are currently delivering, because it might have been blocked if we are woken up by another thread.
2005-07-16Add cancellation protection to pthread_once() as per the standard; ifnathanw
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.
2005-07-01make this compile without PTHREAD_MLOCK_KLUDGE.yamt
2005-06-17Create links for pthread_attr_setschedparam.3peter
and pthread_attr_getschedparam.3 to pthread_attr.3. From Igor Sobrado in PR/29997.
2005-06-17New sentence, new line.wiz
2005-06-17New sentence, new line.wiz
Break much too long line.
2005-06-17Don't create links to pthread_barierattr_init.3 andpeter
pthread_barierattr_destroy.3 but to pthread_barrierattr_init.3 and pthread_barrierattr_destroy.3 (note the 2 rs in barrier).
2005-06-17Fix various spelling errors.peter
From Igor Sobrado in PR/29997.
2005-05-30Use TOOL_GENASSYM. Part of PR toolchain/30350thorpej
2005-04-19Avoid passing along a timespec with a negative number of seconds ifnathanw
the current time plus the caller-supplied time to sleep wraps the time_t. Instead, sleep until INT_MAX.
2005-04-09Merge updates to algorithms from i386 switch code.matt
2005-04-09Add STACKSPACEmatt
2005-04-09Rework and cleanup. Don't use REI, fake a call frame instead.matt
2005-03-21Add restrict qualifiers to <pthread.h> function arguments.kleink
2005-03-21Include <sys/select.h> explicitly rather than relying on other headerskleink
to do it.
2005-03-18Interpose cancellation points in pollts() and pselect(), bringing uskleink
to libc.so.12.127 and libpthread.so.0.6.
2005-03-17Lint warning police -- don't use `//' for comments in C code.jwise
2005-03-10Move up the definition of __LIBC12_SOURCE__; since <poll.h> now includeskleink
<sys/sigtypes.h> this is needed earlier.
2005-02-27Correct the order of arguments to __sigplusset() in two places to correctnathanw
the signal mask experienced by signal handlers in threaded programs. Fixes regress/lib/libpthread/sigmask3.
2005-02-26Keep the kernel updated with signal action signal masks (act.sa_mask) untilnathanw
threads are started, since before that the traditional signal invocation method will be used. Fixes regress/lib/libpthread/sigmask2.
2005-02-26Fetch the old signal mask for the signal action whether or not we'renathanw
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.
2005-02-10Default back pthread__concurrency to 1 until we fix the regression testchristos
related to pthread_kill().