Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Eliminate global mutex by using pthread_once's state field as | davidxu | 2008-05-30 | 1 | -33/+29 | |
| | | | | a semaphore. | |||||
* | - Reduce function call overhead for uncontended case. | davidxu | 2008-05-29 | 3 | -217/+104 | |
| | | | | | - Remove unused flags MUTEX_FLAGS_* and their code. - Check validity of the timeout parameter in mutex_self_lock(). | |||||
* | Remove libc_r's remnant code. | davidxu | 2008-05-06 | 1 | -16/+0 | |
| | ||||||
* | Use UMTX_OP_WAIT_UINT_PRIVATE and UMTX_OP_WAKE_PRIVATE to save | davidxu | 2008-04-29 | 9 | -19/+20 | |
| | | | | time in kernel(avoid VM lookup). | |||||
* | Increase the default MUTEX_ADAPTIVE_SPINS to 2000, after further | kris | 2008-04-26 | 1 | -1/+1 | |
| | | | | | | | | testing it turns out 200 was too short to give good adaptive performance. Reviewed by: jeff MFC after: 1 week | |||||
* | Avoid various shadowed variables. libthr is now almost WARNS=4 clean except | delphij | 2008-04-23 | 4 | -25/+25 | |
| | | | | | | for some const dequalifiers that needs more careful investigation. Ok'ed by: davidxu | |||||
* | Use native rwlock. | davidxu | 2008-04-22 | 1 | -54/+20 | |
| | ||||||
* | _vfork is not in libthr, remove the reference. | davidxu | 2008-04-16 | 1 | -1/+0 | |
| | ||||||
* | don't include pthread_np.h, it is not used. | davidxu | 2008-04-14 | 1 | -1/+0 | |
| | ||||||
* | put THR_CRITICAL_LEAVE into do .. while statement. | davidxu | 2008-04-03 | 1 | -2/+4 | |
| | ||||||
* | add __hidden suffix to _umtx_op_err, this eliminates PLT. | davidxu | 2008-04-03 | 1 | -1/+1 | |
| | ||||||
* | Non-portable functions are in pthread_np.h, fix compiling problem. | davidxu | 2008-04-02 | 1 | -1/+1 | |
| | ||||||
* | Add pthread_setaffinity_np and pthread_getaffinity_np to libc namespace. | davidxu | 2008-04-02 | 1 | -2/+0 | |
| | ||||||
* | Remove unused functions. | davidxu | 2008-04-02 | 2 | -55/+0 | |
| | ||||||
* | Replace function _umtx_op with _umtx_op_err, the later function directly | davidxu | 2008-04-02 | 3 | -49/+31 | |
| | | | | | | returns errno, because errno can be mucked by user's signal handler and most of pthread api heavily depends on errno to be correct, this change should improve stability of the thread library. | |||||
* | Replace userland rwlock with a pure kernel based rwlock, the new | davidxu | 2008-04-02 | 4 | -223/+199 | |
| | | | | | | implementation does not switch pointers when it resumes waiters. Asked by: jeff | |||||
* | Restore normal pthread_cond_signal path to avoid some obscure races. | davidxu | 2008-04-01 | 1 | -2/+3 | |
| | ||||||
* | return EAGAIN early rather than running bunch of code later, micro optimize | davidxu | 2008-04-01 | 1 | -1/+3 | |
| | | | | static branch prediction. | |||||
* | Rewrite rwlock to user atomic operations to change rwlock state, this | davidxu | 2008-03-31 | 3 | -141/+281 | |
| | | | | | | | eliminates internal mutex lock contention when most rwlock operations are read. Orignal patch provided by: jeff | |||||
* | Compile libthr with warnings. | ru | 2008-03-25 | 2 | -6/+8 | |
| | ||||||
* | Fixed mis-implementation of pthread_mutex_get{spin,yield}loops_np(). | ru | 2008-03-25 | 1 | -4/+7 | |
| | | | | Reviewed by: davidxu | |||||
* | Add POSIX pthread API pthread_getcpuclockid() to get a thread's cpu | davidxu | 2008-03-22 | 2 | -0/+48 | |
| | | | | time clock id. | |||||
* | Resolve __error()'s PLT early so that it needs not to be resolved again, | davidxu | 2008-03-21 | 1 | -0/+3 | |
| | | | | | otherwise rwlock is recursivly called when signal happens and the __error was never resolved before. | |||||
* | pthread_mutexattr_destroy() was accidentally broken in last revision, | ru | 2008-03-20 | 1 | -0/+1 | |
| | | | | unbreak it. We should really start compiling this with warnings. | |||||
* | Preserve application code's errno in rtld locking code, it attemps to keep | davidxu | 2008-03-20 | 1 | -2/+31 | |
| | | | | any case safe. | |||||
* | Make pthread_mutexattr_settype to return error number directly and | davidxu | 2008-03-20 | 1 | -3/+1 | |
| | | | | | | conformant to POSIX specification. Bug reported by: modelnine at modelnine dt org | |||||
* | don't reduce new thread's refcount if current thread can not set cpuset | davidxu | 2008-03-19 | 1 | -1/+1 | |
| | | | | for it, since the new thread will reduce it by itself. | |||||
* | - Trim trailing spaces. | davidxu | 2008-03-19 | 1 | -8/+8 | |
| | | | | - Use a different sigmask variable name to avoid confusing. | |||||
* | if passed thread pointer is equal to current thread, pass -1 to kernel | davidxu | 2008-03-19 | 1 | -11/+19 | |
| | | | | to speed up searching. | |||||
* | - Copy signal mask out before THR_UNLOCK(), because THR_UNLOCK() may call | davidxu | 2008-03-18 | 3 | -4/+17 | |
| | | | | | | | | _thr_suspend_check() which messes sigmask saved in thread structure. - Don't suspend a thread has force_exit set. - In pthread_exit(), if there is a suspension flag set, wake up waiting- thread after setting PS_DEAD, this causes waiting-thread to break loop in suspend_common(). | |||||
* | Actually delete SIGCANCEL mask for suspended thread, so the signal will not | davidxu | 2008-03-16 | 1 | -3/+2 | |
| | | | | be masked when it is resumed. | |||||
* | If a thread is cancelled, it may have already consumed a umtx_wake, | davidxu | 2008-03-11 | 1 | -0/+2 | |
| | | | | check waiter and semphore counter to see if we may wake up next thread. | |||||
* | Fix a bug when calculating remnant size. | davidxu | 2008-03-06 | 1 | -1/+1 | |
| | ||||||
* | Don't report death event to debugger if it is a forced exit. | davidxu | 2008-03-06 | 1 | -1/+1 | |
| | ||||||
* | Restore code setting new thread's scheduler parameters, I was thinking | davidxu | 2008-03-06 | 1 | -15/+11 | |
| | | | | | | that there might be starvations, but because we have already locked the thread, the cpuset settings will always be done before the new thread does real-world work. | |||||
* | Increase and decrease in_sigcancel_handler accordingly to avoid possible | davidxu | 2008-03-05 | 1 | -2/+2 | |
| | | | | error caused by nested SIGCANCEL stack, it is a bit complex. | |||||
* | Use cpuset defined in pthread_attr for newly created thread, for now, | davidxu | 2008-03-05 | 3 | -21/+57 | |
| | | | | | | | we set scheduling parameters and cpu binding fully in userland, and because default scheduling policy is SCHED_RR (time-sharing), we set default sched_inherit to PTHREAD_SCHED_INHERIT, this saves a system call. | |||||
* | Check actual size of cpuset kernel is using and define underscore version | davidxu | 2008-03-05 | 1 | -7/+42 | |
| | | | | of API. | |||||
* | If a new thread is created, it inherits current thread's signal masks, | davidxu | 2008-03-04 | 3 | -1/+24 | |
| | | | | | | | | however if current thread is executing cancellation handler, signal SIGCANCEL may have already been blocked, this is unexpected, unblock the signal in new thread if this happens. MFC after: 1 week | |||||
* | Include cpuset.h, unbreak compiling. | davidxu | 2008-03-04 | 1 | -0/+2 | |
| | ||||||
* | implement pthread_attr_getaffinity_np and pthread_attr_setaffinity_np. | davidxu | 2008-03-04 | 4 | -3/+68 | |
| | ||||||
* | Implement functions pthread_getaffinity_np and pthread_setaffinity_np to | davidxu | 2008-03-03 | 2 | -0/+75 | |
| | | | | get and set thread's cpu affinity mask. | |||||
* | _pthread_mutex_isowned_np(): use a more reliable method; the current code | des | 2008-02-14 | 1 | -1/+1 | |
| | | | | | | will work in simple cases, but may fail in more complicated ones. Reviewed by: davidxu | |||||
* | Remove unnecessary prototype. | des | 2008-02-06 | 1 | -1/+0 | |
| | ||||||
* | Per discussion on -threads, rename _islocked_np() to _isowned_np(). | des | 2008-02-06 | 1 | -3/+3 | |
| | ||||||
* | After careful consideration (and a brief discussion with attilio@), change | des | 2008-02-04 | 1 | -1/+1 | |
| | | | | | | | | | the semantics of pthread_mutex_islocked_np() to return true if and only if the mutex is held by the current thread. Obviously, change the regression test to match. MFC after: 2 weeks | |||||
* | Add pthread_mutex_islocked_np(), a cheap way to verify that a mutex is | des | 2008-02-03 | 1 | -0/+16 | |
| | | | | | | | locked. This is intended primarily to support the userland equivalent of the various *_ASSERT_LOCKED() macros we have in the kernel. MFC after: 2 weeks | |||||
* | sem_post() requires to return -1 on error. | davidxu | 2008-01-07 | 1 | -2/+2 | |
| | ||||||
* | call underscore version of pthread_cleanup_pop instead. | davidxu | 2007-12-20 | 1 | -1/+1 | |
| | ||||||
* | Remove vfork() overloading, it is no longer needed. | davidxu | 2007-12-20 | 1 | -9/+0 | |
| |