summaryrefslogtreecommitdiff
path: root/lib/librthread
AgeCommit message (Collapse)Author
2017-10-15Move the thread-related .h files to /usr/src/include/, since thePhilip Guenther
implementation is now spread between libc and librthread. No changes to the content ok mpi@
2017-09-05Move mutex, condvar, and thread-specific data routes, pthread_once, andPhilip Guenther
pthread_exit from libpthread to libc, along with low-level bits to support them. Major bump to both libc and libpthread. Requested by libressl team. Ports testing by naddy@ ok kettenis@
2017-08-01Use "volatile unsigned int" instead of _atomic_lock_t. The _atomic_lock_tMark Kettenis
isn't the same size on all our architectures and should only be used for spin locks. ok visa@, mpi@
2017-07-30disable post fork checks for now, too much turbulence in the airTed Unangst
2017-07-29not all the world is an i386. Back out breakage.Theo de Raadt
2017-07-29Use memory barriers to prevent pointer use before initialization.Paul Irofti
This work was sparked by the topic posted on hn by wuch. I am still not sure that this fixes the defect he claims to have observed because I was not able to create a proper regress test for it to manifest. To that end, a proof of concept is more than welcomed! Thank you for the report! Discussed with and OK kettenis@, tedu@.
2017-07-27bad things can (and will) happen if a threaded program calls fork() andTed Unangst
then strays off the path to exec(). one common manifestation of this problem occurs in pthread_join(), so we can add a little check there. first person to hit this in real life gets to change the error message.
2017-07-04Enable the use of futex(2) in librthread on mips64.Visa Hankala
OK mpi@, deraadt@
2017-06-01Re-enabled futex based condvar & mutexes, they are not the cause ofMartin Pieuchot
vmd(8)'s regression.
2017-06-01New condvar introduced a regression with vmd(8), revert until it is found.Martin Pieuchot
Reported by Gregor Best.
2017-05-29Enable futex-based mutex and condvar.Martin Pieuchot
ok everybody
2017-05-29SPINLOCK_SPIN_HOOK is no more, define our own set of macros.Martin Pieuchot
Prodded by kettenis@ and tedu@
2017-05-28Use membar_enter_after_atomic() and membar_exit_before_atomic().Martin Pieuchot
2017-05-27New mutex and condvar implementations based on futex(2).Martin Pieuchot
Not enabled yet, it needs some SPINLOCK_SPIN_HOOK love and some bumps. Tested by many including sthen@ in a bulk. ok visa@, sthen@, kettenis@, tedu@
2017-02-27RELRO means the __{got,plt}_{start,end} symbols are superfluousPhilip Guenther
ok kettenis@
2017-01-11Add support for AArch64.Patrick Wildt
2017-01-05Now that all non-ARMv7 platforms are gone, tedu the legacy atomicPatrick Wildt
locking code. ok kettenis@
2016-09-04Get rid of ticket support, replace "struct _spinlock" with "_atomic_lock_t".Michal Mazurek
ok tedu@
2016-09-03Remove _USING_TICKETS, it's defined as 0. No functional change.Michal Mazurek
ok tedu@ mpi@
2016-09-01delete wrong cvs $ tagsTheo de Raadt
2016-09-01bumpOtto Moerbeek
2016-09-01Less lock contention by using more pools for mult-threaded programs.Otto Moerbeek
tested by many (thanks!) ok tedu, guenther@
2016-09-01retire sparcTed Unangst
2016-06-01implicit function declaration is the error we really want, not theTed Unangst
annoying strict prototypes
2016-05-20Delete the _SDA_BASE and _SDA2_BASE symbols: they're unnecessary inPhilip Guenther
shared libraries...and I misspelled them anyway
2016-05-11remove hppa64 port, which we never got going beyond broken single users.Theo de Raadt
hppa reverse-stack gives us a valuable test case, but most developers don't have a 2nd one to proceed further with this. ok kettenis
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@
2016-04-15Document PROTO_NORMAL requires matching DEF_{,NON}STDPhilip Guenther
2016-04-15PROTO_NORMAL(pthread_cond_signal) requires DEF_STD(pthread_cond_signal)Philip Guenther
2016-04-15make pthread_barrier_wait behave more like it does on other platforms.Ted Unangst
from Kari Tristan Helgason
2016-04-09replace 0xf57ff05f with dmb syJonathan Gray
spotted by guenther
2016-04-02Wrap <pthread.h> and <pthread_np.h> to eliminate PLT entries for internalPhilip Guenther
references. Use _thread_pagesize for the semaphore mmap size instead of calling getpagesize() each time. ok beck@
2016-04-02Eliminate the need to explicitly invoke syscalls via their _thread_sys_*Philip Guenther
aliases by using a macro REDIRECT_SYSCALL() to map the symbols. Apply that to getthrid(), sysctl(), and issetugid() as well. ok mpi@ beck@
2016-03-21Rename the system call sendsyslog2 to sendsyslog. Keep the old oneAlexander Bluhm
as osendsyslog for a while. The three argument variant is the only one that will stay. input kettenis@; OK deraadt@
2016-03-20Prepare for future ld.so/libc bump: update <tib.h> with the definitionsPhilip Guenther
that will be needed and make libpthread work when ld.so/libc.a provide an initial TIB.
2016-03-10No point in keeping the threading support for vax, I guessPhilip Guenther
2016-01-27Replace the malloc spinlock with a mutex. This lock is held over system callsMark Kettenis
which run for many cycles and may even sleep. This leads to other threads spinning for a long time waiting on the lock. Using a mutex means those threads go to sleep and get woken up when the lock is released, which results in a lot less CPU usage. More work is needed to improve the performance of threaded code that suffers from malloc lock contention, but this diff makes ports like Firefox significantly more usable. Tested by many. ok mpi@, guenther@, tedu@, jca@
2015-12-10use geteuid to allow root to communicate with others.Ted Unangst
report from Jeunder Yu
2015-11-10Split the intra-thread functionality from kill(2) into its own syscallPhilip Guenther
thrkill(2), rolling the kill(2) syscall number with the ABI change to avoid breaking binaries during during the transition. thrkill(2) includes a 'tcb' argument that eliminates the need for locking in pthread_kill() and simplifies pthread_cancel(). Switch __stack_smash_handler() to use thrkill(2) and explicitly unblock SIGABRT. Minor bump to both libc and libpthread: make sure you install a new kernel! ok semarie@
2015-11-01delete old lint ARGSUSED commentsPhilip Guenther
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@
2015-10-18ld.so no longer needs or uses a bind lock, so stop setting it. ThisPhilip Guenther
eliminates a chunk of complexity from the libpthread init and the fork wrapper, as it was the bind lock that needed prebinding before use.
2015-10-15Handle F_ISATTY in the fcntl() stub as wellTheo de Raadt
ok guenther
2015-05-19Instead of testing for __ELF__ and/or vax, leave out the bits for interfacingPhilip Guenther
with ld.so locking whenever building NOPIC pointless use of __ELF__ noted by brad@ ok miod@
2015-05-12Put the right number of leading underscores in ___cerror and __cerror, forMiod Vallat
the sake of libpthread. Probably missed during the a.out->ELF switch, I can't believe this went unnoticed for so long.
2015-05-10In the child after fork, the dl lock has to be forced as its inner spinlockPhilip Guenther
may have been grabbed by another thread in the parent before the fork problem report from dcoppa@, ok kettenis@
2015-04-29Delete the duplicated sched_{policy,param} members from the internal structPhilip Guenther
pthread and instead use the values from the embedded struct pthread_attr. For bonus points, pay attention to the sched_inherit attribute and possibly set the values from the parent thread. Problem noted by natano of bitrig.
2015-04-07Make pthread_atfork() track the DSO that called it like atexit() does,Philip Guenther
unregistering callbacks if the DSO is unloaded. Move the callback handling from libpthread to libc, though libpthread still overrides the inner call to handle locking and thread-library reinitialization. Major version bump for both libc and libpthread. verification that this fixes various ports ajacoutot@ asm assistance miod@; ok millert@ deraadt@
2015-01-24Add back <sys/param.h>; it's needed for MACHINE_STACK_GROWS_UP.Mark Kettenis
ok millert@, tobiasu@
2015-01-16Move to the <limits.h> universe.Theo de Raadt
review by millert, binary checking process with doug, concept with guenther