summaryrefslogtreecommitdiffstats
path: root/lib/librthread (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fix typo in commentmiod2013-06-041-2/+2
|
* unbreakmiod2013-06-031-2/+2
|
* Despite tedu's efforts, fix ERRNOPTR_OFFSET which has changed due to recentmiod2013-06-032-4/+4
| | | | struct pthread layout change.
* THE MACHINE DEPENDENT CERROR CODE HAS HARD CODED OFFSETS INTO PTHREAD_T!tedu2013-06-031-8/+8
| | | | | found the hard way by miod. resize and realign all the locks and semaphores back to the way they were. sometimes i just can't win.
* Make arm compile again. -mojmaja2013-06-021-1/+2
|
* something's not quite right yet. ticket locks result in more CPU usagetedu2013-06-016-52/+40
| | | | | | and spinning in kernel. partially back out, but in a way that makes going forward again easy. seen by ajacoutot
* cleanup and consolidate the spinlock_lock (what a name!) code.tedu2013-06-0125-166/+189
| | | | | | | | | | it's now atomic_lock to better reflect its usage, and librthread now features a new spinlock that's really a ticket lock. thrlseep can handle both types of lock via a flag in the clock arg. (temp back compat hack) remove some old stuff that's accumulated along the way and no longer used. some feedback from dlg, who is concerned with all things ticket lock. (you need to boot a new kernel before installing librthread)
* fix wrong fn name in debugtedu2013-06-011-2/+2
|
* Add utrace(2), a system call allowing for userland to send its own ktracemiod2013-06-011-1/+1
| | | | | | records. From FreeBSD via otto@, with tweaks suggested by guenther@. Commite on behalf of otto@ who is not around, to ride the libc minor bump. Causes a librthread minor bump as well (new syscall).
* If the lock is contended, such that the 'sc' fails, then we need toguenther2013-05-061-4/+7
| | | | | | | reset the %2 register with _SPINLOCK_LOCKED before retrying. tobiasu@ hit the problem and figured out that ".set noreorder" is needed in the ASM
* Extend P_SIGSUSPEND handling in userret() to properly restore thematthew2013-04-292-4/+48
| | | | | | | | | | | | | | | sigmask even if there are no pending signals under the temporary sigmask. Refactor existing select() and poll() system calls to introduce the pselect() and ppoll() system calls. Add rthread wrappers for pselect() and ppoll(). While there, update cancellation point comments to reflect recent fdatasync() addition. Minor bumps for libc and librthread due to new symbols. ok guenther, millert, deraadt, jmc
* remove more references to kern.rthreads sysctl.tedu2013-04-061-4/+2
| | | | many thanks to jmc for noticing
* fix race when exiting a detached thread. observed by and ok guenthertedu2013-04-061-4/+7
|
* - Don't include guard pages in the stack size.kurt2013-03-311-7/+4
| | | | | | From Christian Schulte (cs at schulte.it) - Use stack->sp instead of recalculating it. From guenther@ okay guenther@
* SEM_VALUE_MAX belongs in <limits.h> (via sys/syslimits.h)guenther2013-03-241-3/+3
| | | | | | | struct sem --> struct __sem (doesn't belong in public namespace) Zap pointless _KERNEL tests ok deraadt@
* Do not need machine/param.hderaadt2013-03-211-4/+2
|
* Revert previous diff: sparc and sparc64 don't set the TCB to NULL in exec, yet,guenther2013-02-152-47/+19
| | | | | | and vax doesn't support symbols that are both weak and undefined (yet?). sparc issue diagnosed by kettenis@, vax problem found by todd@
* Make libpthread compatible with an ld.so that does TCB allocation:guenther2013-02-142-19/+47
| | | | | | | | if the initial thread already has a TCB then don't override it, and if the _dl_allocate_tls() and _dl_free_tls() symbols exist then use them instead of malloc/free ok kettenis@
* Userland bits for m68k/ELF. Mostly addition of register prefixes to themiod2013-02-021-12/+11
| | | | | assembler instructions, and cope with the few changes in return values location.
* Make this PIC-aware.miod2013-01-271-2/+6
|
* ARMv7 doesn't support the atomic SWP instruction anymore. Use the atomicpatrick2013-01-231-1/+12
| | | | | | load and store instructions instead. ok miod@
* Add END() directives to the various functions.miod2013-01-111-1/+2
| | | | | | Make the code PIC-aware when necessary (i.e. invoke other functions through the PLT, and access global data through the GOT). No change for non-PIC compilation.
* Switch m88k ports to ELF.miod2013-01-052-14/+14
|
* Do not pass -Wmissing-prototypes when building on a non-ELF platform withmiod2012-11-221-3/+4
| | | | | gcc 3 as the compiler. The way constructors are built triggers this warning, which is fatal because of -Werror. ok espie@ guenther@
* raise() is now correctly defined in libcguenther2012-11-101-9/+1
|
* Define empty CDIAGFLAGS for programs that use Werror.haesbaert2012-09-121-1/+2
| | | | | | Makes "make build" build with WARNINGS=Yes on amd64. ok espie
* We want to check that the dynamic linker is available at run-time, somatthew2012-08-223-26/+42
| | | | | | | | we should actually check for _DYNAMIC at run-time rather than checking for __PIC__ at compile time, since the two are actually independent. Problem and solution identified by guenther; minor tweaks by me. ok guenther
* Test for __PIC__ instead of PIC in preparation for eliminating -DPICmatthew2012-08-222-8/+8
| | | | | | from bsd.lib.mk for C source files. ok deraadt, pascal
* 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
|