summaryrefslogtreecommitdiff
path: root/lib/librthread
AgeCommit message (Collapse)Author
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
2014-12-08avoid void arithmetic. from david carlierTed Unangst
2014-11-16Don't restart syscalls on SIGTHR. When a cancellation happens, we need toPhilip Guenther
unroll to the cancellation check ok tedu@
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@
2014-08-31accept4() should be a cancellation point.Philip Guenther
Update the list in the pthread_testcancel(3) manpage: several were missing. noted by miod@
2014-08-31Declare and document getthrid()Philip Guenther
indirectly prodded by krw@
2014-08-09Only need <stdint.h> and not <inttypes.h> herePhilip Guenther
2014-07-16zap trailing newlines; "go for it" deraadtOkan Demirmen
2014-07-10__tfork_thread is in libc, so move the manpage over tooPhilip Guenther
ok deraadt@
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-07-01Use a flag on the pthread_t to indicate that the thread's stack wasPhilip Guenther
allocated by the kernel's execve bits. ok matthew@
2014-06-27Fix mmap() flag usage: explicitly specify MAP_PRIVATE and drop uselessMatthew Dempsky
MAP_FILE and MAP_HASSEMAPHORE flags. Discussed with deraadt, tedu, and kettenis
2014-06-23Remove unintended statement from my copyright blockPhilip Guenther
2014-05-02- Adjust pthread_stackseg_np to return the page aligned addressable stackKurt Miller
range. okay kettenis@, guenther@, deraadt@
2014-04-18It's been a quarter century: we can assume volatile is present with that name.Philip Guenther
2014-03-18Retire hp300, mvme68k and mvme88k ports. These ports have no users, keepingMiod Vallat
this hardware alive is becoming increasingly difficult, and I should heed the message sent by the three disks which have died on me over the last few days. Noone sane will mourn these ports anyway. So long, and thanks for the fish.
2014-03-16lint is dead (long live the lint!), so stop using it as a cpp conditionalPhilip Guenther
(namespace pollution!) or talking about its opinion on code. ok krw@
2013-12-18Provide a random stackgrap on pthread frames. Use _STACKALIGNBYTES toTheo de Raadt
ensure the frames are aligned correctly. Discussed at length with guenther and kettenis ok kettenis, this is the right first step
2013-12-12Fix static linking of libpthread: have crt0 invoke __init_tcb() if it'sPhilip Guenther
defined and we don't think ld.so has already done the TCB setup. ok and much discussion miod@
2013-12-11revert to return EPERM for sem_init pshared until it really worksTed Unangst
reported by zhuk
2013-12-08Reduce the random name length when sem_init is called with psharedFederico G. Schwindt
following what is recommended for mkstemp. This reduces the number of calls to sched_yield considerably. tedu@ ok.
2013-11-29Don't try to reuse _initial_thread in the fork() wrapper, as thePhilip Guenther
thread's existing handle must continue to be valid and it didn't fully 'change' the thread handle anyway. For pthread_main_np(), use a new flag, THREAD_ORIGINAL, to indicate that the flagged thread is the original thread for *this* process. Fixes some ConsoleKit failures according to aja@
2013-11-26Remove unused var and include. Fix errno values as per spec.Federico G. Schwindt
NULL semaphore in sem_close(). Minor cosmetic changes. tedu@ zhuk@ ok
2013-11-22don't use PAGE_SIZE, it is not portable. Ted can polish this afterTheo de Raadt
if he wants, but let us get the tree building.
2013-11-21remove dead assignment as reported by llvm.Federico G. Schwindt
2013-11-21handle the fourth vararg value to sem_openTed Unangst
ok zhuk and presumably fgsch who just sent me a similar diff
2013-11-20shared semaphore fixes. first, eliminate the sem inside a sem indirection.Ted Unangst
it's not needed (mindless holdover from earlier prototype). everything is simpler and sem_init shared semaphores even work now (confirmed by sthen). correct the einval checks to not deref a pointer before the null check. in sem_open, if we created the semaphore, we need to initialize the spinlock.
2013-11-20oops, forgot about unnamed shared semsTed Unangst
2013-11-20zhuk and i have slightly different styles. unify and consistifyTed Unangst
2013-11-18interprocess semaphores ala sem_open. mostly following in the patternTed Unangst
of shm_open. with some additions and fixes from zhuk.
2013-11-13use sysctl vm.psstrings to calculate stack bounds, rather than USRSTACK.Theo de Raadt
long discussions with guenther, kurt, kettenis etc etc etc
2013-11-02remove unnecessary spinlock that slowed down pthread_getspecific.Ted Unangst
original report and fix provided by John Carr. ok guenther kettenis
2013-10-23In pthread_kill()/pthread_cancel(), hold the target thread's flagsPhilip Guenther
lock across the kill, so that it can't exit (and its tid be reused!) before the kill() discussed with tedu@ marc@
2013-10-04_thread_sys_tcdrain() doesn't exist and isn't usedPhilip Guenther
2013-08-28Following the ARM manuals and cookbooks, ldrex/strex don't have implicitPatrick Wildt
barriers. Therefore it is required to add a memory berrier, so that it is ensured that all observers observed the change. ok rapha@
2013-08-26Use %r27 as the thread control block pointer, allowing for __get_tcb() callsMiod Vallat
in libpthread to be optimized away. While there, follow DG/UX's example of using more than one register for thread purposes (after all, the ABI reserves four of them), and also use %r26 to store a pointer to the current thread's errno. Since it is not possible to initialize %r26 at thread creation without intrusive and potentially race-prone changes, have __tfork() reset %r26 to zero, and libpthread's __cerror lazy initialize it. As soon as %r26 is nonzero, it will be used instead of calling __errno(). This means that binaries linked against HEAD libpthread need to run on HEAD kernels, and we are belatedly jumping on the 64-bit time_t bump (since there are no 64-bit time_t m88k snapshots yet). Joint work with guenther@; "Your love of asm is sick and wrong, and yet beautiful." and ok guenther@
2013-08-13Switch time_t, ino_t, clock_t, and struct kevent's ident and dataPhilip Guenther
members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
2013-08-06Remove support for COMPILER_VERSION == gcc2.Miod Vallat
Change the logic depending upon COMPILER_VERSION everywhere, to assume gcc4 is the norm and to explicitely test for gcc3 when a different behaviour is required. No functional change intended. Be sure to `make install' in share/mk before attempting to do anything.
2013-07-30Free the list used for tracking the pthread_{get,set}specific()Philip Guenther
data after calling all the destructors. noted by kettenis@ diff by tedu@
2013-07-30Stop overwriting the dying thread's struct thread as its tid member mayPhilip Guenther
be concurrently updated by __threxit() prompted by a report from Alf Schlichting (a.schlichting (at) lemarit.com) ok kettenis@
2013-07-05ELF_TOOLCHAIN bye bye.Miod Vallat
2013-07-05VAX ELF userland bits. Consists mostly of register prefix additions.Miod Vallat
2013-06-25nmask and omask only used on ELF. Noted by todd@Philip Guenther
2013-06-21The bind lock must only be grabbed with all signals masked.Philip Guenther
backtrace of example case from sthen@ ok kettenis@ millert@