summaryrefslogtreecommitdiffstats
path: root/lib/librthread (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure ccpascal2012-08-221-2/+2
| | | | | | | invocations. This allows us to use the compiler builtin define __PIC__ to check for PIC/PIEness rather than passing -DPIC. Simplifies PIE work a lot. ok matthew@, conceptually ok kurt@
* A couple small but long anticipated changes:matthew2012-08-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | - Link libpthread.so with -znodlopen. Because libpthread overrides the weak symbols in libc, we can't allow it to be dynamically loaded or else libc's weak symbols might have already been resolved by ld.so. (Also, major bump because this is technically a backwards incompat change in behavior, although dlopen()ing libpthread never really worked.) - Link libc.so with -nodefaultlibs -lgcc. This ensures that libc doesn't try to link against itself (which ld.so wouldn't like). - Change GCC 4 to link shared objects with -lpthread and -lc as appropriate, now that there's no issues with doing so. This means that it's no longer necessary to patch software to use -pthread instead of -lpthread. (Ports tree rejoice!) Also, to preemptively answer this question: No, this does not eliminate the need for LD_PRELOAD=libpthread.so. That's a separate issue that won't be resolved until we eliminate libc's weak symbols. Discussed extensively on email and icb over the past few months. ok deraadt
* Oops, on a.out architectures __cerror() is called _cerror(). Fixmatthew2012-08-151-3/+9
| | | | | | accordingly so vax can build again. ok deraadt
* Add explicit references from rthread.o to all of the weak symbolmatthew2012-08-131-1/+71
| | | | | | | | | | | overrides provided by libpthread.a. This ensures that statically linked threaded programs use (e.g.) __cerror() from libpthread.a instead of libc.a. (Same idea previously used by libuthread.) Thanks to fgsch@ for pointing out libuthread's solution to the static linking problem. ok guenther@, tedu@;
* Fix caching of stacks allocated with the default attributes.guenther2012-08-041-6/+8
| | | | based on a diff from Christian Schulte (cs at schulte.it)
* remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.okan2012-08-021-3/+1
| | | | ok guenther@
* Update to reflect API changesguenther2012-06-211-17/+26
|
* __tfork() needs to set the stack address of the new thread in the kernel,guenther2012-06-212-8/+6
| | | | | | | | | so that it can't get a signal while still running on the parent thread's stack. Also, pass in sizeof(struct __tfork) to provide forward compat when more members are added. This is an ABI change, so switch syscall numbers and bump lib majors this time. ok deraadt@ matthew@
* Style nits from Brad.pirofti2012-05-061-26/+26
|
* Add pthread spinlock support.pirofti2012-05-034-3/+124
| | | | | | | | | | | Implementation, documentation and naive regression tests for: - pthread_spin_init() - pthread_spin_destroy() - pthread_spin_lock() - pthread_spin_trylock() - pthread_spin_unlock() Implementation okay guenther@, documentation okay jmc@.
* Honor subsystem style.pirofti2012-04-232-71/+55
| | | | | | `Visual inspection looks ok' kurt@. >From Brad
* Remove "#define _POSIX_THREADS" line before include <pthread.h>.miod2012-04-172-6/+2
| | | | The latter contains "#define _POSIX_THREADS 1" which makes gcc 2.95 complain.
* Add new mutex type, PTHREAD_MUTEX_STRICT_NP which checks for applicationkurt2012-04-141-3/+8
| | | | | | | | errors similar to PTHREAD_MUTEX_ERRORCHECK, however upon error it aborts. The rational is that many applications don't check the return values on pthread functions and will miss the errors that ERRORCHECK returns. PTHREAD_MUTEX_STRICT_NP will be our default mutex type for awhile okay guenther@ dcoppa@
* Provide _atomic_lock() and __cerror() for hppa64. Makes hppa64 build again.jsing2012-04-132-0/+74
|
* Use PTHREAD_MUTEX_DEFAULT in static init and mutexattr_init. If thekurt2012-04-132-7/+15
| | | | | | default mutex type changes to NORMAL, when there is an uninitialized mutex provided to unlock, allow it to succeed similar to an unlocked mutex. For other cases abort instead of segfault. okay guenther@
* Per POSIX, PTHREAD_MUTEX_NORMAL type mutexes have undefined behavior forkurt2012-04-131-7/+31
| | | | | | certain conditions. In the case of unlocking an unlocked mutex we will allow that to succeed, all other undefined behaviors will result in an immediate abort(). okay guenther@
* Add sigwaitinfo and sigtimedwait stubs under #if 0; a bit more kernelguenther2012-04-131-1/+40
| | | | | support is needed before they can be usefully enabled but I don't want to misplace this diff yet again
* remove rfork(); ok guenther miodderaadt2012-04-121-4/+2
|
* Minor bump after my previous commit. Noticed by deraadt@.pirofti2012-04-111-1/+1
|
* Add pthread barrier support.pirofti2012-04-114-2/+237
| | | | | | | | | | | | | | | Implementation and documentation for: - pthread_barrier_init() - pthread_barrier_destroy() - pthread_barrier_wait() - pthread_barrierattr_init() - pthread_barrierattr_destroy() - pthread_barrierattr_getpshared() - pthread_barrierattr_setpshared() Currently only private barriers are supported. Okay guenther@.
* pthread_setcanceltype() shouldn't be a cancelation pointguenther2012-04-101-2/+1
| | | | ok kurt@
* Fix typo.jsing2012-04-061-3/+3
|
* Remove pthread_suspend* and related functions. This is part of thekurt2012-03-224-62/+4
| | | | rthreads major library bump from last night. okay kettenis@
* bump majors on libc and rthreads for the additions to libc and transferguenther2012-03-221-2/+2
| | | | of __tfork_thread from rthreads to libc
* closefrom() should be a cancellation pointguenther2012-03-221-2/+16
|
* tfork_thread has been moved to libcguenther2012-03-2213-921/+0
|
* Move __tfork_thread() from rthreads (libpthread) to libc so thatguenther2012-03-221-2/+2
| | | | | | it can be used for not-strictly-threading purposes ok matthew@ kurt@
* Clean up unnecessary prototypes. Pointed out by brad@guenther2012-03-201-7/+1
|
* Permit recursive locking in _rthread_dl_lock(), as an so's destructorguenther2012-03-201-2/+42
| | | | | | may need to call dlclose(). problem observed by Antti Harri (iku at openbsd.fi), ok kurt@
* Force sched_yield() to be resolved before calling dlctl(DL_SET*LCK) withguenther2012-03-141-1/+2
| | | | | | a function that can call sched_yield(), to avoid recursion ok kurt@ kettenis@
* Don't trust the environment if issetugid()guenther2012-03-131-1/+3
|
* Sync the assembly statements with <machine/lock.h> for consistency.miod2012-03-031-5/+9
|
* Bump minor for recent additionsguenther2012-03-031-1/+1
|
* sem_timedwait() should return ETIMEDOUT instead of EWOULDBLOCK on timeoutguenther2012-03-031-2/+2
|
* Add sem_timewait() and fix sem_wait()'s handling of signals, soguenther2012-03-033-21/+56
| | | | | | | that it resumes waiting unless the thread was canceled. As part of this, change the internal _sem_wait() function to return zero on success and an errno value on failure instead of 1 on success and zero on failure.
* fix check when setting the contention scope. harmless atm but still wrong.fgsch2012-03-021-2/+2
| | | | guenther@ ok.
* for readability, put the label on it's own line.fgsch2012-03-021-2/+3
|
* _SPINLOCK_UNLOCKED isn't zero everywhere (*cough*hppa*cough*), soguenther2012-03-021-1/+2
| | | | | | | sem_init() can't assume that calloc will leave the embedded spinlock in the unlocked state ok miod@ otto@
* Our default mutex type is PTHREAD_MUTEX_ERRORCHECK, for which tryingguenther2012-02-281-1/+20
| | | | | | | | | | to unlock an uninitialized mutex is required to return EPERM, so add the necessary checks. For recursive mutexes, return an error from pthread_mutex_lock() if the count would overflow. problem observed in glib testing by aja@
* fix __errno symbol namemiod2012-02-271-2/+2
|
* Fix buglets.miod2012-02-261-3/+3
|
* __cerror gets invoked with errno in v0, not a0.miod2012-02-261-2/+2
|
* Fix label for threaded binaries to link.miod2012-02-261-2/+2
|
* sched_yield() is the standard name while pthread_yield() is theguenther2012-02-241-2/+2
| | | | non-standard alias, so prefer the former
* PTHREAD_MUTEX_NORMAL mutexes are supposed to self-deadlock, not abort.guenther2012-02-231-3/+16
| | | | | That deadlock can be exited via a timeout for pthread_mutex_timedlock(). Unwind all the state when pthread_mutex_timedlock() times out
* Add pthread_condattr_{get,set}clock(), requested by aja@guenther2012-02-234-45/+115
| | | | Add pthread_mutex_timedlock(), requested by dcoppa@
* Make pthread_suspend_np() and pthread_resume_np() simply fail insteadguenther2012-02-211-11/+6
| | | | of doing the Wrong Thing.
* Fix problems revealed by regress/lib/libpthread/stack/stack.cguenther2012-02-191-11/+8
|
* Use 'base' as an intermediate char* variable to avoid void* arithmeticguenther2012-02-191-4/+4
|
* Extend miod's fix CFLAGS fix to all gcc2 platforms (suggested by Tobiasguenther2012-02-191-3/+5
| | | | Ulmer). Only pull in bsd.lib.mk once to avoid linking objects twice