summaryrefslogtreecommitdiff
path: root/lib/librthread/rthread_sig.c
AgeCommit message (Collapse)Author
2016-05-07Use a Thread Information Block in both single and multi-threaded programs.Philip Guenther
This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable! Make libpthread dlopen'able by moving the cancelation wrappers into libc and doing locking and fork/errno handling via callbacks that libpthread registers when it first initializes. 'errno' *must* be declared via <errno.h> now! Clean up libpthread's symbol exports like libc. On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec. Testing by various, particularly sthen@ and patrick@ ok kettenis@
2015-10-23Merge the sigaction() and sigprocmask() overloads/wrappers from libpthreadPhilip Guenther
into libc, and move pthread_sigmask() as well (just a trivial wrapper). This provides consistent handling of SIGTHR between single- and multi-threaded programs and is a step in the merge of all the libpthread overloads, providing some ASM and Makefile bits that the other wrappers will need. ok deraadt@ millert@
2014-11-16Don't assume __thrsigdivert() autorestarts on EINTR. This lets us check forPhilip Guenther
cancellation properly when a handled (but not waited for) signal occurs ok tedu@
2013-06-21Move the declaration of _thread_sys_sigprocmask() to rthread.hPhilip Guenther
2012-11-10raise() is now correctly defined in libcPhilip Guenthe
2012-04-13Add sigwaitinfo and sigtimedwait stubs under #if 0; a bit more kernelPhilip Guenthe
support is needed before they can be usefully enabled but I don't want to misplace this diff yet again
2012-01-17Reimplement mutexes, condvars, and rwlocks to eliminate bugs,Philip Guenthe
particularly the "consume the signal you just sent" hang, and putting the wait queues in userspace. Do cancellation handling in pthread_cond_*wait(), pthread_join(), and sem_wait(). Add __ prefix to thr{sleep,wakeup,exit,sigdivert}() syscalls; add 'abort" argument to thrsleep to close cancellation race; make thr{sleep,wakeup} return errno values via *retval to avoid touching userspace errno.
2011-12-27Don't let applications block, wait for, or handle SIGTHR, as thePhilip Guenthe
thread library uses it internally for cancellation.
2011-12-05Implement cancelation for the basic syscall cancelation points,Philip Guenthe
using previously allocated SIGTHR to interrupt in-process syscalls and fixing the spelling of "cancelled" along the way. Modeled on FreeBSD's libthr
2011-11-06Move <machine/spinlock.h> into rthread.h; strip out unnecessary #includesPhilip Guenthe
2009-11-27Convert thrsigdivert to (almost) be sigtimedwait by adding siginfo_tPhilip Guenthe
and struct timespec * argument. sigtimedwait is just a one line wrapper after this. "get it in" deraadt@, tedu@, cheers by others
2009-02-20thrsigdivert() takes a sigset_t, not a pointer to one. Detected byPhilip Guenthe
finally reading the lint warnings (sigh) ok tedu@
2008-10-03Make sigwait() work correctly. In particular, it'll work when thePhilip Guenthe
signal is already pending in the calling thread or the main thread and there's no longer a race condition where the signal could be diverted but sigwait() would still block. There were some off-by-one errors too. (The checking of the main thread's pending list is just until a pending list for the process can be added to struct process. For now, such signals end up as pending on the main thread.) oks tedu@ and art@
2008-04-24Return the proper values upon failure per POSIX for pthread_sigmask(3) andKurt Miller
sigprocmask(2) in threaded programs. From Philip Guenther <guenther at sendmail.com> via PR library/5795. okay marc@
2005-12-30prototype all the thread syscalls in rthread.h for now.Ted Unangst
update for new thrwakeup that takes a count argument
2005-12-19this file didn't exist in 2004, so copyright must be 2005Ted Unangst
2005-12-13update thrsleep and thrwakeup - first arg changed from long to void *Ted Unangst
2005-12-03add userland thread library. incomplete, but functionalTed Unangst