summaryrefslogtreecommitdiffstats
path: root/lib/libkse
Commit message (Collapse)AuthorAgeFilesLines
...
* Use the correct type for and argument. Recent changes to namespace.hdeischen2006-03-281-1/+1
| | | | | | exposed this bug. Reported by: kris
* Suuply the name of the version map and let bsd.lib.mk supplydeischen2006-03-161-3/+7
| | | | the link arguments.
* Add compatibility symbol maps. libpthread (.so.1 and .so.2)deischen2006-03-13103-2/+491
| | | | | | | | | | | used LIBTHREAD_1_0 as its version definition, but now needs to define its symbols in the same namespace used by libc. The compatibility hooks allows you to use libraries and binaries built and linked to libpthread before libc was built with symbol versioning. The shims can be removed if libpthread is given a version bump. Reviewed by: davidxu
* Only catch SIGINFO (for dumping thread states) when LIBPTHREAD_DEBUGdeischen2006-03-063-16/+28
| | | | | | is defined in the environment. Requested by: jmg & a few others
* Add some more pthread stubs so that librt can use them.deischen2006-03-051-4/+35
| | | | | | | The thread jump table has been resorted, so you need to keep libc, libpthread, and libthr in sync. Submitted by: xu
* Fix a race condition introduced when redzones were added. Use andeischen2006-02-241-5/+4
| | | | | | atomic operation to return and adjust the stack. Submitted by: luoqi
* Eliminate a race condition in timed waits (cv, mutex, and sleeps).deischen2006-02-233-30/+30
| | | | | | MFC Candidate. PR: 93592
* Don't forget to initialize a tailq before using it.deischen2006-02-161-0/+1
| | | | | MFC candidate Noticed by: luoqi
* Increase the number of spinlocks, since libc's malloc implementation isjasone2006-01-131-1/+1
| | | | | | about to significantly increase the number of spinlocks used. Approved by: markm (mentor)
* In preparation for a new malloc implementation:jasone2006-01-121-3/+3
| | | | | | | | | | | | | * Add posix_memalign(). * Move calloc() from calloc.c to malloc.c. Add a calloc() implementation in rtld-elf in order to make the loader happy (even though calloc() isn't used in rtld-elf). * Add _malloc_prefork() and _malloc_postfork(), and use them instead of directly manipulating __malloc_lock. Approved by: phk, markm (mentor)
* For the ``#ifdef NOTYET'' code that allows calling non-async-safebrian2006-01-031-1/+1
| | | | | | | | | | functions in the child after a fork() from a threaded process, use __sys_setprocmask() rather than setprocmask() to keep our signal handling sane. Without this fix, signals are essentially ignored in said child and things such as protection violations result in an endless busy loop. Reviewed by: deischen
* o Include <sys/time.h>marcel2005-11-191-13/+14
| | | | | | o Make this ILP32/LP64 clean: cast pointers to long o Code conditional upon DEBUG must also be conditional upon _LIBC_R_
* o Include <string.h>marcel2005-11-191-3/+5
| | | | o Make this ILP32/LP64 clean: cast pointers to long.
* Fix typo: s/_LIBC_R/_LIBC_R_/marcel2005-11-191-1/+1
|
* Include files thr_condattr_pshared.c and thr_mattr_pshare.c.davidxu2005-10-241-0/+2
|
* Add functions pthread_mutexattr_setpshared and pthread_mutexattr_getpshared.davidxu2005-10-241-0/+56
|
* Add function pthread_condattr_setpshared and pthread_condattr_getpshared.davidxu2005-10-241-0/+56
|
* Modify the code path of the ifdef NOTYET part of _kse_single_thread():brian2005-09-242-8/+11
| | | | | | | | | | | | | | | | | | | | o Don't reinitialise the atfork() handler list in the child. We are meant to call the child handler, and on subsequent fork()s should call all three functions as normal. o Don't reinitialise the thread specific keyed data in the child after a fork. Applications may require this for context. o Reinitialise curthread->tlflags after removing ourselves from (and reinitialising) the various internal thread lists. o Reinitialise __malloc_lock in the child after fork() (to balance our explicitly taking the lock prior to the fork()). With these changes, it is possible to enable the NOTYET code in thr_kern.c to allow the use of non-async-safe functions after fork()ing from a threaded program. Reviewed by: Daniel Eischen <deischen@freebsd.org> [_malloc_lock reinitialisation has since been moved to avoid polluting the !NOTYET code]
* Include needed headers that were obtained through <pthread.h>. Sort headersstefanf2005-09-014-4/+12
| | | | while here.
* Allocate a thread's tcb last so it is easier to handle failures todeischen2005-08-301-20/+21
| | | | | | malloc() siginfo. PR: 85468
* Handle failure to malloc() part of the thread structure.deischen2005-08-291-3/+4
| | | | PR: 83457
* Don't attempt to initialize the rtld lock if it can't be malloc()'d.deischen2005-08-291-5/+7
| | | | PR: 83452
* - Prefix MUTEX_TYPE_MAX with PTHREAD_ to avoid namespace pollution.stefanf2005-08-192-3/+3
| | | | | | - Remove the macros MUTEX_TYPE_FAST and MUTEX_TYPE_COUNTING_FAST. OK'ed by: deischen
* Add a cancellation point for usleep().deischen2005-08-031-1/+16
|
* Remove an unused variable.deischen2005-07-291-1/+0
|
* Catch up with the atomic_FOO_ptr() changes and silence a few warnings.deischen2005-07-291-7/+14
|
* Bump the shared library version number of all libraries that have notkensmith2005-07-221-1/+1
| | | | | | | been bumped since RELENG_5. Reviewed by: ru Approved by: re (not needed for commit check but in principle...)
* Clean out the leftovers from the i386_set_gsbase() TLS conversion.peter2005-06-292-51/+8
| | | | | | | | Like on libthr, there is an i386_set_gsbase() stub implementation here to avoid libc.so.5 issues. This should likely be a weak symbol and I expect this will be fixed soon. Approved by: re
* Fix off-by-one nanosecond in macro TIMESPEC_ADD.davidxu2005-06-221-1/+1
| | | | | | Reviewed by: deischen Approved by: re (dwhite) MFC after : 4 days
* Remove the special _amd64_set_gsbase() code for #ifdef COMPAT_32BIT, nowpeter2005-04-262-10/+0
| | | | | that the amd64 kernel implements i386_get/set_gsbase(). All the rest of the ldt backwards compat code should go away soon.
* Use the i386_set_gsbase() syscall if it is implemented in the kernel.peter2005-04-142-16/+41
| | | | | This is a little hairy here because the allocation and usage of this functionality is split into two places in libpthread.
* Use the new atomic_cmpset_32().cognet2005-04-071-15/+0
|
* Eliminate plt relocation for kse_switchin.davidxu2005-03-212-0/+2
|
* Change the spin lock logic to a reasonable one. We should spin whendelphij2005-02-271-1/+1
| | | | | | | | | the lock is held by other thread, but not when nobody owns it. According to deischen@, this part of code will never be hit in our threads library, since it does not use locks without wait/wakeup functions. Spotted by: mingyanguo via ChinaUnix.net forum Reviewed by: deischen
* Bring in a more healthy version of the libpthread for arm, which usescognet2005-02-264-4/+12
| | | | ARM_TP_ADDRESS.
* Somewhere along the line, tick accumulation for SA threads wasdeischen2005-02-181-1/+1
| | | | | | | changed to use the statclock. Make sure we calculate the value of a tick correctly in userland. Noticed by: Kazuaki Oda <kaakun at highway dot ne dot jp>
* Set the default guardsize and stacksize in the default threaddeischen2005-02-151-0/+2
| | | | attribute when the library is initialized.
* Increase the default stacksizes:deischen2005-02-134-9/+22
| | | | | | 32-bit 64-bit main thread 2MB 4MB other threads 1MB 2MB
* Don't panic when sigsuspend is interrupted by a cancellation.deischen2004-12-191-2/+7
| | | | PR: 75273
* Use a generic way to back threads out of wait queues when handlingdeischen2004-12-1816-347/+411
| | | | | | | | | | | | | | | | | | | | | | | | | signals instead of having more intricate knowledge of thread state within signal handling. Simplify signal code because of above (by David Xu). Use macros for libpthread usage of pthread_cleanup_push() and pthread_cleanup_pop(). This removes some instances of malloc() and free() from the semaphore and pthread_once() implementations. When single threaded and forking(), make sure that the current thread's signal mask is inherited by the forked thread. Use private mutexes for libc and libpthread. Signals are deferred while threads hold private mutexes. This fix also breaks www/linuxpluginwrapper; a patch that fixes it is at http://people.freebsd.org/~deischen/kse/linuxpluginwrapper.diff Fix race condition in condition variables where handling a signal (pthread_kill() or kill()) may not see a wakeup (pthread_cond_signal() or pthread_cond_broadcast()). In collaboration with: davidxu
* i386_set_ldt() is not available when running 32 bit binaries on amd64peter2004-11-062-0/+13
| | | | | kernels. Use the recently exposed direct-set routines instead. This is only activated for when we compile i386 support libraries on amd64.
* Cosmetic tweaks to reduce diffs to the i386 counterpart.peter2004-11-061-2/+3
|
* Partial support of KSE for arm.cognet2004-11-054-59/+66
|
* Save cancelflags in signal frame, this fixes a problem thatdavidxu2004-11-012-0/+3
| | | | | | | a thread in pthread_cond_wait handled a signal can no longer be canceled. Reviewed by: deischen
* Make pthread_mutex_trylock(3) return EBUSY on failure, as all softwaregreen2004-10-311-8/+1
| | | | | | | | | packages expect and seems to be most correct according to the slightly- ambiguous standards. MFC after: 1 month Corroborated by: POSIX <http://tinyurl.com/4uvub> Reviewed by: silence on threads@
* For variables that are only checked with defined(), don't provideru2004-10-241-1/+1
| | | | any fake value.
* Check unhandled signals before thread marks itself as DEAD,davidxu2004-10-231-1/+14
| | | | | this reduces chances of signal losting problem found by Peter Holm <peter@holm.cc>
* 1. Move thread list flags into new separate member, and atomicallydavidxu2004-10-235-24/+45
| | | | | | | | | | | put DEAD thread on GC list, this closes a race between pthread_join and thr_cleanup. 2. Introduce a mutex to protect tcb initialization, tls allocation and deallocation code in rtld seems no lock protection or it is broken, under stress testing, memory is corrupted. Reviewed by: deischen patch partly provided by: deischen
* Decrease reference count if we won't use the thread, this avoids memorydavidxu2004-10-211-0/+4
| | | | leak under some cases.
* if system scope thread didn't set timeout, don't call clock_gettime syscalldavidxu2004-10-081-8/+9
| | | | | | before and after sleeping. Reviewed by: deischen
OpenPOWER on IntegriCloud