summaryrefslogtreecommitdiffstats
path: root/lib/libkse/thread
Commit message (Collapse)AuthorAgeFilesLines
* Remove the libkse directory. It was unhooked from the build and kernelbrooks2014-04-16113-18469/+0
| | | | | | | support removed in 2008 (prior to 8.0). Approved by: deischen, imp MFC after: 3 days
* Call the fcntl compatiblity wrapper from the thread library fcntl wrappersdfr2008-05-301-1/+2
| | | | | | so that they get the benefit of the (limited) forward ABI compatibility. MFC after: 1 week
* Fix some "in in" typos in comments.brueffer2008-03-261-1/+1
| | | | | | | PR: 121490 Submitted by: Anatoly Borodin <anatoly.borodin@gmail.com> Approved by: rwatson (mentor), jkoshy MFC after: 3 days
* Add missing #includedes2008-02-061-0/+1
| | | | | | Spotted by: tinderbox Submitted by: Pietro Cerutti <gahr@gahr.ch> Pointy hat to: des
* Add pthread_mutex_isowned_np() here as well; libthr and libkse are supposeddes2008-02-061-0/+10
| | | | | | to have identical functionality. MFC after: 2 weeks
* Remove hacks to allow libkse to export its symbols in the LIBTHREAD_1_0deischen2007-12-16101-479/+0
| | | | | version namespace which was needed before the library version was bumped.
* Set the tcb (thread control block) in the child process after a fork.deischen2007-12-061-0/+13
| | | | | | | | | | This protects against a race with an upcall in the parent during the fork which can clobber the parent's tcb before the vm space is copied in the child. The child then gets a corrupted tcb that is either null or that points to another thread that doesn't exist in the child (after a fork, only the fork()ing thread exists in the child). Reported by: Arno J. Klaassen (arno at heho / snv / jussieu / fr)
* WARNS=3'ify.deischen2007-11-30107-123/+494
|
* Initialize the current thread and signal locks so that sigaction()deischen2007-11-301-5/+16
| | | | | | will work after a fork(). WARNS=3'ify.
* Fix pointer dereferencing problems in _pthread_mutex_init_calloc_cb() thatjasone2007-11-281-1/+2
| | | | were obscured by pseudo-opaque pthreads API pointer casting.
* Add _pthread_mutex_init_calloc_cb() to libthr and libkse, so that malloc(3)jasone2007-11-275-18/+40
| | | | | (part of libc) can use pthreads mutexes without causing infinite recursion during initialization.
* Move the added code in revision 1.26 into function pthread_key_create,davidxu2007-11-261-6/+6
| | | | it should be there.
* MFlibthr:davidxu2007-11-191-1/+5
| | | | In _pthread_key_create() ensure that libkse is initialized.
* Add a new "non-portable" mutex type, PTHREAD_MUTEX_ADAPTIVE_NP. Thiskris2007-10-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | is also implemented in glibc and is used by a number of existing applications (mysql, firefox, etc). This mutex type is a default mutex with the additional property that it spins briefly when attempting to acquire a contested lock, doing trylock operations in userland before entering the kernel to block if eventually unsuccessful. The expectation is that applications requesting this mutex type know that the mutex is likely to be only held for very brief periods, so it is faster to spin in userland and probably succeed in acquiring the mutex, than to enter the kernel and sleep, only to be woken up almost immediately. This can help significantly in certain cases when pthread mutexes are heavily contended and held for brief durations (such as mysql). Spin up to 200 times before entering the kernel, which represents only a few us on modern CPUs. No performance degradation was observed with this value and it is sufficient to avoid a large performance drop in mysql performance in the heavily contended pthread mutex case. The libkse implementation is a NOP. Reviewed by: jeff MFC after: 3 days
* Enable symbol versioning by default. Use WITHOUT_SYMVER to disable it.deischen2007-05-131-1/+1
| | | | | | | | | | Warning, after symbol versioning is enabled, going back is not easy (use WITHOUT_SYMVER at your own risk). Change the default thread library to libthr. There most likely still needs to be a version bump for at least the thread libraries. If necessary, this will happen later.
* Catch up with the renaming of the private version namespace.deischen2007-04-291-1/+1
|
* Add a reference and lock the target thread when setting its name.deischen2007-04-231-5/+24
| | | | Submitted by: davidxu (via libthr)
* Oops, fix a typo in the last commit :-/brian2007-03-051-1/+1
|
* In the NOTYET code path when a process forks, the remainingbrian2007-03-051-7/+4
| | | | | | | | | | | child thread goes back to system scope rather than process scope. This allows an ensuing exec() to actually work. This change was made a year ago here, but I "forgot" to commit it :( Approved by: deischen MFC after: 3 weeks
* Remove 3rd clause, renumber, ok per emailimp2007-01-1257-228/+57
|
* Clean bound and non-bound pthread structures consistently beforepeadar2006-12-181-4/+5
| | | | | | | | | | | | they become candidates for reuse. Without this fix, some of the state from a thread structure's previous incarnation could interfere with its new one. Specifically, a non-bound thread started as "suspended" (see pthread_attr_setcreatesuspend_np()) might not get scheduled at all when resumed, as the "active" flag would be set spuriously. Reviewed by: deischen@, davidxu@ MFC after: 1 week
* If a thread was detached, return EINVAL instead, the error codedavidxu2006-11-281-1/+1
| | | | | | | | is also returned by pthread_detach() if a thread was already detached, the error code was already documented: > [EINVAL] The implementation has detected that the value speci- > fied by thread does not refer to a joinable thread.
* o Remove a cruft prevented libpthread sigaction(2) wrapper tomaxim2006-06-093-7/+18
| | | | | | | | | | | | | do its work for SIGINFO. Always install libpthread signal handler wrapper for SIGINFO even if user SIG_IGN's or SIG_DFL's it. SIGINFO has a special meaning for libpthread: when LIBPTHREAD_DEBUG enviroment variable defined it is used for dumping an information about threads to /tmp/. Reported by: mi Reviewed by: deischen MFC after: 2 weeks
* Export offsets of thread signal pending set and signal mask for debugger.davidxu2006-05-171-0/+2
|
* Unexpand TAILQ_FIRST(foo) == NULL to TAILQ_EMPTY.delphij2006-04-132-5/+5
| | | | Ok'ed by: davidxu
* Bring libpthread up to WARNS level 2.des2006-03-292-7/+15
| | | | Reviewed by: deischen
* Fix prototype mismatch and use of un-namespaced pthread functions.des2006-03-281-11/+7
|
* Use the correct type for and argument. Recent changes to namespace.hdeischen2006-03-281-1/+1
| | | | | | exposed this bug. Reported by: kris
* Add compatibility symbol maps. libpthread (.so.1 and .so.2)deischen2006-03-13101-1/+485
| | | | | | | | | | | 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
* 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
* 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
|
* 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
* 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
OpenPOWER on IntegriCloud