summaryrefslogtreecommitdiffstats
path: root/lib/librthread/rthread_libc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move mutex, condvar, and thread-specific data routes, pthread_once, andguenther2017-09-051-262/+0
| | | | | | | | 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@
* New mutex and condvar implementations based on futex(2).mpi2017-05-271-2/+14
| | | | | | | | | 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@
* Get rid of ticket support, replace "struct _spinlock" with "_atomic_lock_t".akfaew2016-09-041-6/+5
| | | | ok tedu@
* delete wrong cvs $ tagsderaadt2016-09-011-2/+1
|
* Less lock contention by using more pools for mult-threaded programs.otto2016-09-011-17/+32
| | | | tested by many (thanks!) ok tedu, guenther@
* Use a Thread Information Block in both single and multi-threaded programs.guenther2016-05-071-1/+2
| | | | | | | | | | | | | | | | | 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@
* Replace the malloc spinlock with a mutex. This lock is held over system callskettenis2016-01-271-4/+21
| | | | | | | | | | | | | 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@
* Make pthread_atfork() track the DSO that called it like atexit() does,guenther2015-04-071-1/+18
| | | | | | | | | | 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@
* cleanup and consolidate the spinlock_lock (what a name!) code.tedu2013-06-011-4/+4
| | | | | | | | | | it's now atomic_lock to better reflect its usage, and librthread now features a new spinlock that's really a ticket lock. thrlseep can handle both types of lock via a flag in the clock arg. (temp back compat hack) remove some old stuff that's accumulated along the way and no longer used. some feedback from dlg, who is concerned with all things ticket lock. (you need to boot a new kernel before installing librthread)
* Remove "#define _POSIX_THREADS" line before include <pthread.h>.miod2012-04-171-3/+1
| | | | The latter contains "#define _POSIX_THREADS 1" which makes gcc 2.95 complain.
* Implement cancelation for the basic syscall cancelation points,guenther2011-12-051-190/+1
| | | | | | 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-3/+1
|
* remove _MALLOC_LOCK_INIT; major bump; ok deraadt@otto2008-06-131-6/+1
|
* - add missing libc locking functions for _thread_atexit_lock() andkurt2008-01-231-1/+18
| | | | _thread_atexit_unlock(). okay tedu@
* - make arc4random*() functions thread safe. Use a custom spinlock functionkurt2008-01-011-1/+18
| | | | | | | | | | | instead of the generic pthread macros since free(3) uses __arc4_getbyte() when freeing small sized allocations and the generic pthread macros call malloc(3). - eliminate passing pointers to a static variable with global scope (rs) for additional code clarity and reduction. - shlib minor bumps for libc and libpthread due to new functions. From andreas@ with some bits from me. okay tedu@ marc@ w/some spot checking from millert@
* _FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, sokurt2007-06-051-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | isolate its usage to libpthread only and replace with generic non-static mutex support in the one place it is needed: - remove _FD_LOCK/UNLOCK from lseek and ftruncate in libc and make the functions weak so that libpthread can override with its own new versions that do the locking. - remove _thread_fd_lock/unlock() weak functions from libc and adjust libpthread for the change. - add generic _thread_mutex_lock/unlock/destroy() weak functions in libc to support non-static mutexes in libc and add libpthread and librthread implementations for them. libc can utilize non-static mutexes via the new _MUTEX_LOCK/UNLOCK/DESTROY() macros. Actually these new macros can support both static and non-static mutexes but currently only using them for non-static. - make opendir/closedir/readdir/readdir_r/seekdir/telldir() thread-safe for both thread libraries by using a non-static mutex in the struct _dirdesc (typedef DIR), utilizing it in the *dir functions and remove remaining and incorrect _FD_LOCK/UNLOCK() use in libc. - add comments to both thread libraries to indicate libc depends on the current implementation of static mutex initialization. suggested by marc@ - major bump libc and libpthread due to function removal, structure change and weak symbol conversions. okay marc@, tedu@
* two comment typos from tberttedu2006-10-271-2/+192
|
* move malloc lock to libc interface filetedu2006-01-051-1/+23
|
* add -Wstrict-prototypes -Wmissing-prototypes -Wsign-comparemarc2006-01-051-0/+127
Minor tweaks to compile with the above, primarily in fixing the conflicts between semaphore.h and rthread.h "i like the additional warnings" tedu@