summaryrefslogtreecommitdiff
path: root/lib/libthr/thread
Commit message (Collapse)AuthorAgeFilesLines
* Merge head 185728 via 186368: initialize dummy argument to umtx_op()Peter Wemm2008-12-211-1/+1
| | | | | | | Approved by: re (kib) Notes: svn path=/releng/7.1/; revision=186369
* MFC SVN rev 181099:David Xu2008-08-051-1/+1
| | | | | | | Correctly return result in pthread_condattr_getpshared. Notes: svn path=/stable/7/; revision=181318
* MFC: r179358,179434 - make libc's fcntl symbol weak and extend the limitedDoug Rabson2008-06-061-1/+2
| | | | | | | forward ABI compatibility for fcntl to the thread libraries. Notes: svn path=/stable/7/; revision=179608
* MFC revision 1.8:David Xu2008-04-221-2/+1
| | | | | | | fix return value for function pthread_mutexattr_settype(). Notes: svn path=/stable/7/; revision=178394
* MFC:David Xu2008-04-121-3/+35
| | | | | | | Preserve and restore errno. Notes: svn path=/stable/7/; revision=178137
* MFC:David Xu2008-04-127-16/+15
| | | | | | | retire type umtx_t. Notes: svn path=/stable/7/; revision=178136
* MFC:David Xu2008-04-114-222/+280
| | | | | | | | | | - add _umtx_op_err function to improve stability because of errno changed by application signal handler code. - use kernel based userland rwlock to implement pthread_rwlock, improve performance in most cases. Notes: svn path=/stable/7/; revision=178135
* MFC:David Xu2008-04-113-11/+38
| | | | | | | Unblock SIGCANCEL for thread created by cleanup handler. Notes: svn path=/stable/7/; revision=178090
* MFC Revision 1.6:David Xu2008-03-231-2/+4
| | | | | | | > Use macro THR_CLEANUP_PUSH/POP. Notes: svn path=/stable/7/; revision=177515
* MFC: Merge malloc(3) improvements and fixes. The highlights are:Jason Evans2008-03-071-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Avoid re-zeroing memory in calloc() when possible. * Use pthread mutexes where possible instead of libc "spinlocks", and actually spin some during contention before blocking. * Implement dynamic load balancing of thread-->arena mapping. * Avoid floating point math in order to avoid increased context switch overhead for applications that otherwise would not use floating point math. * Restructure how sbrk() and mmap() are used to acquire memory mappings. This provides a way to force malloc to only use sbrk(), which can be useful in the context of resource limits. * Reduce the number of mmap() calls typically necessary when allocating a chunk. * Track dirty unused pages so that they can be purged if they exceed a threshold. * Try to realloc() large objects in place. * Manage page runs with trees instead of chunk maps, which allows logarithmic-time run allocation. Notes: svn path=/stable/7/; revision=176922
* MFC revision 1.64:David Xu2007-12-131-5/+7
| | | | | | | | | | > Enclose all code for macro ENQUEUE_MUTEX in do while statement, and > add missing brackets. Approved by: re (kensmith) Notes: svn path=/stable/7/; revision=174572
* MFC: Add support for non-portable adaptive mutexes, as well as experimentalKris Kennaway2007-11-143-26/+86
| | | | | | | | | support for spinning/yielding loops. Approved by: re@ (kensmith) Notes: svn path=/stable/7/; revision=173593
* MFC: 1.7Marius Strobl2007-11-091-1/+5
| | | | | | | | | | | | | | In _pthread_key_create() ensure that libthr is initialized. This fixes a NULL-dereference of curthread when libstdc+ initializes the exception handling globals on archs we can't use GNU TLS due to lack of support in binutils 2.15 (i.e. arm and sparc64), yet, thus making threaded C++ programs compiled with GCC 4.2.1 work again on these archs. Approved by: re (kensmith) Notes: svn path=/stable/7/; revision=173508
* Output error message to STDERR_FILENO.David Xu2007-08-071-1/+1
| | | | | | | Approved by: re (bmah) Notes: svn path=/head/; revision=171763
* backout experimental adaptive spinning mutex for product use.David Xu2007-05-093-9/+0
| | | | Notes: svn path=/head/; revision=169413
* If a thread who's name is being set is not the current thread, use macrosDavid Xu2007-04-051-2/+2
| | | | | | | | | | THR_THREAD_LOCK and THR_THREAD_UNLOCK instead, this should fix wrong lock level problem. Bug reported by: ed dot maste at gmail dot com Notes: svn path=/head/; revision=168382
* Remove 3rd clause, renumber, ok per emailWarner Losh2007-01-1221-88/+22
| | | | Notes: svn path=/head/; revision=165967
* Insert mutex at tail if it has highest ceiling.David Xu2007-01-051-1/+1
| | | | Notes: svn path=/head/; revision=165791
* Oops, don't corrupt the list.David Xu2007-01-051-1/+1
| | | | Notes: svn path=/head/; revision=165790
* Check if the PP mutex is recursive, if we have already locked it, place theDavid Xu2007-01-051-9/+28
| | | | | | | mutex in right order sorted by priority ceiling. Notes: svn path=/head/; revision=165789
* get LIBPTHREAD_ADAPTIVE_SPIN early, so it can be used for some globalDavid Xu2006-12-201-2/+5
| | | | | | | mutexes. Notes: svn path=/head/; revision=165371
* Check environment variable PTHREAD_ADAPTIVE_SPIN, if it is set, useDavid Xu2006-12-205-1/+8
| | | | | | | it as a default spin cycle count. Notes: svn path=/head/; revision=165370
* - Remove variable _thr_scope_system, all threads are system scope.David Xu2006-12-154-24/+8
| | | | | | | | - Rename _thr_smp_cpus to boolean variable _thr_is_smp. - Define CPU_SPINWAIT macro for each arch, only X86 supports it. Notes: svn path=/head/; revision=165241
* Create inline function _thr_umutex_trylock2 to only try one atomicDavid Xu2006-12-142-3/+11
| | | | | | | | operation, if it is failed, we call syscall directly, this saves one atomic operation per lock contention. Notes: svn path=/head/; revision=165206
* Correctly check failed syscall.David Xu2006-12-121-10/+10
| | | | Notes: svn path=/head/; revision=165115
* Move checking for c_has_waiters into low level _thr_ucond_signal andDavid Xu2006-12-122-16/+12
| | | | | | | | | | _thr_ucond_broadcast, clear condition variable pointer in cancellation info after returing from _thr_ucond_wait, since kernel has already dropped the internal lock, so we don't need to unlock it in cancellation handler again. Notes: svn path=/head/; revision=165110
* test cancel_pending to save a thr_wake call in some specical cases.David Xu2006-12-061-1/+1
| | | | Notes: svn path=/head/; revision=164929
* _thr_ucond_wait drops lock, we should pick it up again.David Xu2006-12-051-0/+1
| | | | Notes: svn path=/head/; revision=164927
* the c_has_waiters is lazily updated, temporarily disable the falseDavid Xu2006-12-051-0/+2
| | | | | | | alarm code. Notes: svn path=/head/; revision=164905
* Use ucond to implement barrier.David Xu2006-12-052-8/+10
| | | | Notes: svn path=/head/; revision=164903
* Add _thr_ucond_init().David Xu2006-12-052-3/+10
| | | | Notes: svn path=/head/; revision=164902
* Tweak _thr_cancel_leave_defer a bit to fix a possible race.David Xu2006-12-051-3/+7
| | | | Notes: svn path=/head/; revision=164896
* Fix typo, I was using a wrong header file, and the typo is not detectedDavid Xu2006-12-041-1/+1
| | | | | | | by compiler. Notes: svn path=/head/; revision=164878
* Use kernel provided userspace condition variable to implement pthreadDavid Xu2006-12-046-96/+105
| | | | | | | condition variable. Notes: svn path=/head/; revision=164877
* If a thread was detached, return EINVAL instead, the error codeDavid Xu2006-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. Notes: svn path=/head/; revision=164715
* Eliminate atomic operations in thread cancellation functions, it shouldDavid Xu2006-11-2412-213/+176
| | | | | | | reduce overheads of cancellation points. Notes: svn path=/head/; revision=164583
* Move code calculating new inherited priority into single function.David Xu2006-11-111-30/+21
| | | | Notes: svn path=/head/; revision=164178
* Don't inherit THR_FLAGS_NEED_SUSPEND for child process, child processDavid Xu2006-10-141-0/+2
| | | | | | | | only has one thread, setting the flag can cause the thread to be suspended and no another thread will resume it. Notes: svn path=/head/; revision=163346
* o Make _thr_umutex_init a function.David Xu2006-10-132-21/+23
| | | | | | | | | o Eliminate unused parameter for some functions. o Convert type of first parameter to void * for _thr_umtx_wait and _thr_umtx_wake. Notes: svn path=/head/; revision=163334
* Use type pthread_state for thread state.David Xu2006-10-131-1/+1
| | | | Notes: svn path=/head/; revision=163307
* use rtprio_thread system call to get or set thread priority.David Xu2006-09-217-16/+90
| | | | Notes: svn path=/head/; revision=162499
* Use return value of _thr_umutex_lock instead of using zero.David Xu2006-09-081-2/+1
| | | | Notes: svn path=/head/; revision=162143
* Replace internal usage of struct umtx with umutex which can supportsDavid Xu2006-09-0614-158/+94
| | | | | | | real-time if we want, no functionality is changed. Notes: svn path=/head/; revision=162061
* Same as pthread_setschedparam, use sizeof(struct sched_param) instead.David Xu2006-09-051-2/+2
| | | | Notes: svn path=/head/; revision=162037
* Pass correct parameter size.David Xu2006-09-051-2/+2
| | | | Notes: svn path=/head/; revision=162036
* Remove unused file.David Xu2006-08-291-59/+0
| | | | Notes: svn path=/head/; revision=161711
* pthread_sigmask is in thr_sig.c, remove this file.David Xu2006-08-281-52/+0
| | | | Notes: svn path=/head/; revision=161695
* Kill unused files.David Xu2006-08-282-187/+0
| | | | Notes: svn path=/head/; revision=161682
* Use umutex APIs to implement pthread_mutex, member pp_mutexq is addedDavid Xu2006-08-284-73/+116
| | | | | | | | | into pthread structure to keep track of locked PTHREAD_PRIO_PROTECT mutex, no real mutex code is changed, the mutex locking and unlocking code should has same performance as before. Notes: svn path=/head/; revision=161681
* Add umutex APIs.David Xu2006-08-282-0/+92
| | | | Notes: svn path=/head/; revision=161680