summaryrefslogtreecommitdiffstats
path: root/lib/librthread (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Validate in pthread_attr_set{scope,sched{param,policy},inheritsched}()guenther2012-02-192-3/+16
| | | | the requested new value
* Fix previous commit: _rthread_init() was static.guenther2012-02-183-15/+22
| | | | Improve consistency of error naming
* Before using _thread_pagesize, make sure _rthread_init() has been calledguenther2012-02-181-1/+5
|
* id tag.fgsch2012-02-181-0/+1
|
* Fix the handling of the stackaddr, stacksize, and guardsize attributes:guenther2012-02-185-101/+141
| | | | | | | | | | | don't try to merge values, round the sizes separately, and don't try to unmap application-supplied stacks. Copy from uthread the caching of default-sized stacks. Have pthread_attr_init() and pthread_create() get the default attributes from staticly allocated pthread_attr_t. Cache the pagesize in _rthread_init() and provide a macro for rounding to it based on suggestions from kettenis@ and tedu@, ok kettenis@
* Missing cerror bits.miod2012-02-181-0/+55
|
* Work around compiler confusion while building rthread.o on vax.miod2012-02-181-2/+6
|
* Initialize the scope, policy, and inherit members in pthread_attr_init()guenther2012-02-181-1/+4
| | | | | | so that their pthread_attr_get* don't return bogus values. issue noted and tested by aja@
* Allow librthread to build on mips64.miod2012-02-172-11/+72
|
* Set __isthreaded in pthread_create() instead of _rthread_init() such that itkettenis2012-02-161-3/+4
| | | | | | | | properly represents whether a process is multi-threaded or not. This fixes a bug where if a forked child would create a new thread we would not set __isthreaded. ok guenther@
* Nothing important, just switching from pthreads to rthreadsguenther2012-02-151-2/+7
|
* Bump major to be current libpthread major +1, so we can switch over cleanly.guenther2012-02-151-1/+1
| | | | | If we have to revert to user-space threads, we'll do another major bump of libpthread going back
* Add pthread_rwlockattr_{get,set}pshared() andguenther2012-02-153-4/+54
| | | | | | pthread_mutexattr_{get,set}kind_np() tweaked diff from brad
* @($*& Merging patches resulted in a line being duplicated instead ofguenther2012-01-251-2/+1
| | | | moved. Unlocking a spinlock twice is bad, mmkay?
* Reimplement mutexes, condvars, and rwlocks to eliminate bugs,guenther2012-01-1722-307/+720
| | | | | | | | | | | | | particularly the "consume the signal you just sent" hang, and putting the wait queues in userspace. Do cancellation handling in pthread_cond_*wait(), pthread_join(), and sem_wait(). Add __ prefix to thr{sleep,wakeup,exit,sigdivert}() syscalls; add 'abort" argument to thrsleep to close cancellation race; make thr{sleep,wakeup} return errno values via *retval to avoid touching userspace errno.
* Fix $OpenBSD tagguenther2012-01-041-1/+1
|
* Add some sanity checks, set errno accordingly to POSIX and add the namedmpi2012-01-041-4/+56
| | | | | | | semaphore stubs already provided by libpthread. We may move them in their own file in the future when we figure out a real implementation. Discussed with and looks ok to guenther@
* Split out the semaphore functions.mpi2012-01-043-180/+207
| | | | ok guenther@
* Delete some parameter names and extra semicolons that slipped throughguenther2012-01-041-5/+5
|
* pthread_self() may be much cheaper and never more expensive than getthrid()guenther2011-12-283-11/+12
| | | | so prefer it for identifying the current thread
* Don't let applications block, wait for, or handle SIGTHR, as theguenther2011-12-272-4/+39
| | | | thread library uses it internally for cancellation.
* On failure, pthread_kill() should return the errno, not -1guenther2011-12-271-2/+2
|
* formatting errors, found using freebsd's "igor";jmc2011-12-241-5/+5
|
* Add pthread_mutex_{get,set}prioceiling()guenther2011-12-222-2/+57
|
* Split out the pthread_rwlock* and pthread_once() functions from rthread_sync.cguenther2011-12-215-277/+350
| | | | to new files rthread_rwlock.c, rthread_rwlockattr.c, and rthread_once.c
* Split out the pthread_mutexattr_* functions from rthread_sync.c toguenther2011-12-214-48/+119
| | | | | | | new file rthread_mutexattr.c. Add basic implementations of pthread_mutexattr_{set,get}{protocol,prioceiling} Requested by aja
* Mark sigthr()'s sig argument as __unusedguenther2011-12-051-2/+2
|
* Implement cancelation for the basic syscall cancelation points,guenther2011-12-056-201/+583
| | | | | | using previously allocated SIGTHR to interrupt in-process syscalls and fixing the spelling of "cancelled" along the way. Modeled on FreeBSD's libthr
* Set the initfirst and nodelete flags on the shared library, in anticipationguenther2011-11-271-1/+2
| | | | of support in ld.so
* Add the __cerror asm bits for per-thread errno support for powerpc.kettenis2011-11-091-0/+41
| | | | ok guenther@
* Oh yeah, with TLS-lite we can get the thread handle without walking theguenther2011-11-091-23/+2
| | | | | | thread list reminded by dhill@
* Add the __cerror asm bits for per-thread errno support for hppa.kettenis2011-11-081-0/+33
| | | | ok guenther@
* Include <stddef.h> to make sure offsetof() is defined.kettenis2011-11-081-0/+2
| | | | ok guenther@
* Copy support for sched_get_priority_{min,max} from libpthread.guenther2011-11-063-3/+50
| | | | Requested by many to ease substitution of librthread for libpthread
* Move <machine/spinlock.h> into rthread.h; strip out unnecessary #includesguenther2011-11-0612-85/+14
|
* Remove some blatant lies. Provide a variant 1 archs with a defaultguenther2011-10-191-3/+5
| | | | | value for THREAD_ERRNOPTR_OFFSET (can't be used from ASM or ld.so, but it lets things compile as we fill things in)
* Use __tfork, __get_tcb, and __set_tcb to have a real TCB and per-threadguenther2011-10-1727-101/+876
| | | | | errno. The ASM bits for _cerror are sketchy or missing for some archs but that can be corrected in-tree.
* Deal with the horror that is gcc asm constraints by copying theguenther2011-10-132-8/+4
| | | | | | known good version of ldstub in the kernel. (It's finally in, aja!) ok kettenis@
* Increase the stack offset for the new rthread from (BIAS+128) toguenther2011-10-131-4/+5
| | | | | | | | (BIAD+CC64FSZ) so that there's sufficient space even when _rthread_start is compiled without optimization. Also, clear the frame pointer to help make gdb happier. ok kettenis@
* Convert rfork_thread() from int$80 to syscall.guenther2011-10-131-18/+12
| | | | | | | Tune the asm slightly to avoid using the stack and use smaller instructions. Pass threxit() a NULL pointer. seemed okay to kettenis@
* Return the correct errno (EBUSY) when pthread_mutex_trylock() isguenther2011-09-221-2/+2
| | | | | called on an ERRORCHECK mutex that is locked by this thread. Problem observed by uwe@
* fix a few bugs in the thread specific data functionstedu2011-07-051-5/+36
|
* Sync with amd64, to allow this to compile without warnings with gcc4:miod2010-12-031-6/+6
| | | | | | ``Correct the _atomic_lock() asm so that gcc accepts the constraints when compiling without optimization; fix copied from the kernel's atomic.h'' spotted by jim@
* If the stack size attribute isn't larger than the guard-page sizeguenther2010-05-261-1/+3
| | | | | | attribute then make pthread_create() return EINVAL instead of whatever was in errno on entry (possibly making it appear it succeeded when it really failed). Encountered by Jung (moorang at gmail.com).
* New functions: bump the minorguenther2010-04-121-1/+1
|
* Add pthread_rwlock_timed{rd,wr}lock().guenther2010-04-121-3/+68
| | | | | | Avoid missed wakeups in pthread_rwlock_{rd,wr}lock() by linking the spinlocks. ok tedu@
* Use MACHINE_CPU instead of MACHINE_ARCH to pick the correct machine dependentmiod2010-02-031-2/+2
| | | | | | | files or directories when applicable. The inspiration and name of MACHINE_CPU come from NetBSD, although the way to provide it to Makefiles is completely different. ok kettenis@
* This might not be necessary, but Just In Case: since the underlyingguenther2009-11-281-1/+1
| | | | | syscall ABI has changed and everything is going to need to be relinked anyway, bump the rthread major
* Convert thrsleep() to an absolute timeout with clockid to eliminate aguenther2009-11-274-34/+21
| | | | | | race condition and prep for later support of pthread_condattr_setclock() "get it in" deraadt@, tedu@, cheers by others
* Convert thrsigdivert to (almost) be sigtimedwait by adding siginfo_tguenther2009-11-272-4/+5
| | | | | | | and struct timespec * argument. sigtimedwait is just a one line wrapper after this. "get it in" deraadt@, tedu@, cheers by others