summaryrefslogtreecommitdiffstats
path: root/lib/libthr
Commit message (Collapse)AuthorAgeFilesLines
* Remove options MK_LIBKSE and DEFAULT_THREAD_LIB now that we no longerru2008-03-291-4/+1
| | | | build libkse. This should fix WITHOUT_LIBTHR builds as a side effect.
* Compile libthr with warnings.ru2008-03-253-6/+9
|
* Fixed mis-implementation of pthread_mutex_get{spin,yield}loops_np().ru2008-03-251-4/+7
| | | | Reviewed by: davidxu
* Add POSIX pthread API pthread_getcpuclockid() to get a thread's cpudavidxu2008-03-223-0/+50
| | | | time clock id.
* Resolve __error()'s PLT early so that it needs not to be resolved again,davidxu2008-03-211-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,ru2008-03-201-0/+1
| | | | unbreak it. We should really start compiling this with warnings.
* Preserve application code's errno in rtld locking code, it attemps to keepdavidxu2008-03-201-2/+31
| | | | any case safe.
* Make pthread_mutexattr_settype to return error number directly anddavidxu2008-03-201-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 cpusetdavidxu2008-03-191-1/+1
| | | | for it, since the new thread will reduce it by itself.
* - Trim trailing spaces.davidxu2008-03-191-8/+8
| | | | - Use a different sigmask variable name to avoid confusing.
* if passed thread pointer is equal to current thread, pass -1 to kerneldavidxu2008-03-191-11/+19
| | | | to speed up searching.
* - Copy signal mask out before THR_UNLOCK(), because THR_UNLOCK() may calldavidxu2008-03-183-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 notdavidxu2008-03-161-3/+2
| | | | be masked when it is resumed.
* If a thread is cancelled, it may have already consumed a umtx_wake,davidxu2008-03-111-0/+2
| | | | check waiter and semphore counter to see if we may wake up next thread.
* Fix a bug when calculating remnant size.davidxu2008-03-061-1/+1
|
* Don't report death event to debugger if it is a forced exit.davidxu2008-03-061-1/+1
|
* Restore code setting new thread's scheduler parameters, I was thinkingdavidxu2008-03-061-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 possibledavidxu2008-03-051-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,davidxu2008-03-053-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.
* Add more cpu affinity function's symbols.davidxu2008-03-051-0/+6
|
* Check actual size of cpuset kernel is using and define underscore versiondavidxu2008-03-051-7/+42
| | | | of API.
* If a new thread is created, it inherits current thread's signal masks,davidxu2008-03-043-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.davidxu2008-03-041-0/+2
|
* implement pthread_attr_getaffinity_np and pthread_attr_setaffinity_np.davidxu2008-03-044-3/+68
|
* Implement functions pthread_getaffinity_np and pthread_setaffinity_np todavidxu2008-03-033-1/+78
| | | | get and set thread's cpu affinity mask.
* _pthread_mutex_isowned_np(): use a more reliable method; the current codedes2008-02-141-1/+1
| | | | | | will work in simple cases, but may fail in more complicated ones. Reviewed by: davidxu
* style.Makefile(5)obrien2008-02-136-6/+6
|
* style(9)obrien2008-02-132-6/+6
|
* Yet another pointy hat: when I zapped FBSDprivate_1.1, I forgot to movedes2008-02-061-0/+1
| | | | its contents to FBSDprivate_1.0.
* Remove unnecessary prototype.des2008-02-061-1/+0
|
* Convert pthread.map to the format expected by version_gen.awk, and modifydes2008-02-062-11/+3
| | | | | | the Makefile accordingly; libthr now explicitly uses libc's Versions.def. MFC after: 2 weeks
* Remove incorrectly added FBSDprivate_1.1 namespace, and move symbols whichdes2008-02-061-12/+4
| | | | are new in FreeBSD 8 to the appropriate namespace.
* Per discussion on -threads, rename _islocked_np() to _isowned_np().des2008-02-062-5/+5
|
* After careful consideration (and a brief discussion with attilio@), changedes2008-02-041-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 isdes2008-02-032-0/+31
| | | | | | | 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
* SYSTEM_SCOPE_ONLY flag is no longer needed, it is the only mode libthrdavidxu2008-01-181-2/+0
| | | | supports.
* sem_post() requires to return -1 on error.davidxu2008-01-071-2/+2
|
* call underscore version of pthread_cleanup_pop instead.davidxu2007-12-201-1/+1
|
* Remove vfork() overloading, it is no longer needed.davidxu2007-12-202-11/+0
|
* Add function prototypes.davidxu2007-12-171-1/+7
|
* 1. Add function pthread_mutex_setspinloops_np to turn a mutex's spindavidxu2007-12-143-29/+114
| | | | | | | | loop count. 2. Add function pthread_mutex_setyieldloops_np to turn a mutex's yield loop count. 3. Make environment variables PTHREAD_SPINLOOPS and PTHREAD_YIELDLOOPS to be only used for turnning PTHREAD_MUTEX_ADAPTIVE_NP mutex.
* Enclose all code for macro ENQUEUE_MUTEX in do while statement, anddavidxu2007-12-111-5/+7
| | | | | | add missing brackets. MFC: after 1 day
* Fix pointer dereferencing problems in _pthread_mutex_init_calloc_cb() thatjasone2007-11-281-7/+3
| | | | 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-272-6/+28
| | | | | (part of libc) can use pthreads mutexes without causing infinite recursion during initialization.
* Simplify code, fix a thread cancellation bug in sem_wait and sem_timedwait.davidxu2007-11-231-21/+15
|
* Reuse nwaiter member field to record number of waiters, in sem_post(),davidxu2007-11-211-7/+31
| | | | | this should reduce the chance having to do a syscall when there is no waiter in the semaphore.
* Remove warning level and aliasing restrictions.davidxu2007-11-211-2/+0
|
* Convert ceiling type to unsigned integer before comparing, fix compilerdavidxu2007-11-211-3/+3
| | | | warnings.
* Add some function prototypes.davidxu2007-11-211-0/+5
|
* Remove umtx_t definition, use type long directly, add wrapper functiondavidxu2007-11-217-18/+31
| | | | | _thr_umtx_wait_uint() for umtx operation UMTX_OP_WAIT_UINT, use the function in semaphore operations, this fixed compiler warnings.
OpenPOWER on IntegriCloud