summaryrefslogtreecommitdiffstats
path: root/lib/librthread/rthread_sig.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move sigwait(3) from libpthread to libcjca2019-01-121-75/+0
| | | | | | | | POSIX wants it in libc, that's where the function can be found on other systems. Reported by naddy@, input from naddy@ and guenther@. "looks ok" guenther@, ok deraadt@ Note: riding the libc/libpthread major cranks earlier today.
* Use a Thread Information Block in both single and multi-threaded programs.guenther2016-05-071-10/+8
| | | | | | | | | | | | | | | | | 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@
* Merge the sigaction() and sigprocmask() overloads/wrappers from libpthreadguenther2015-10-231-37/+1
| | | | | | | | | 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@
* Don't assume __thrsigdivert() autorestarts on EINTR. This lets us check forguenther2014-11-161-4/+6
| | | | | | cancellation properly when a handled (but not waited for) signal occurs ok tedu@
* Move the declaration of _thread_sys_sigprocmask() to rthread.hguenther2013-06-211-3/+1
|
* raise() is now correctly defined in libcguenther2012-11-101-9/+1
|
* Add sigwaitinfo and sigtimedwait stubs under #if 0; a bit more kernelguenther2012-04-131-1/+40
| | | | | support is needed before they can be usefully enabled but I don't want to misplace this diff yet again
* Reimplement mutexes, condvars, and rwlocks to eliminate bugs,guenther2012-01-171-2/+2
| | | | | | | | | | | | | 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.
* Don't let applications block, wait for, or handle SIGTHR, as theguenther2011-12-271-2/+35
| | | | thread library uses it internally for cancellation.
* Implement cancelation for the basic syscall cancelation points,guenther2011-12-051-3/+6
| | | | | | using previously allocated SIGTHR to interrupt in-process syscalls and fixing the spelling of "cancelled" along the way. Modeled on FreeBSD's libthr
* Move <machine/spinlock.h> into rthread.h; strip out unnecessary #includesguenther2011-11-061-11/+1
|
* Convert thrsigdivert to (almost) be sigtimedwait by adding siginfo_tguenther2009-11-271-2/+3
| | | | | | | and struct timespec * argument. sigtimedwait is just a one line wrapper after this. "get it in" deraadt@, tedu@, cheers by others
* thrsigdivert() takes a sigset_t, not a pointer to one. Detected byguenther2009-02-201-2/+2
| | | | | | finally reading the lint warnings (sigh) ok tedu@
* Make sigwait() work correctly. In particular, it'll work when theguenther2008-10-031-38/+7
| | | | | | | | | | | | | 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@
* Return the proper values upon failure per POSIX for pthread_sigmask(3) andkurt2008-04-241-2/+2
| | | | | | | sigprocmask(2) in threaded programs. From Philip Guenther <guenther at sendmail.com> via PR library/5795. okay marc@
* prototype all the thread syscalls in rthread.h for now.tedu2005-12-301-6/+2
| | | | update for new thrwakeup that takes a count argument
* this file didn't exist in 2004, so copyright must be 2005tedu2005-12-191-2/+2
|
* update thrsleep and thrwakeup - first arg changed from long to void *tedu2005-12-131-5/+5
|
* add userland thread library. incomplete, but functionaltedu2005-12-031-0/+90