summaryrefslogtreecommitdiffstats
path: root/lib/libpthread (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* In pthread_key_delete(), only scan other threads if the key was allocatedguenther2011-07-031-12/+12
| | | | | | and handle the case of specific_data being NULL. Pointed out by fgsch@, ok tedu@
* pthread_key_delete should delete the data, so it's not reused bytedu2011-07-021-1/+13
| | | | | a later pthread_key_create. bug report from Henry Precheur. ok guenther mikeb
* More NULL -> 0 fallout.miod2011-04-091-3/+3
|
* Make the pthread scheduler block signals while restoring a newlystsp2011-01-251-1/+12
| | | | | selected thread's state. Fixes random qemu crashes. ok miod@
* Revert previous commit: if gcc picks a memory operand for the asm thenguenther2011-01-041-2/+2
| | | | | 'movl' will result in an assembler error. Sorry llvm-clang users: fix your compiler to match gcc+as
* Make this compile with llvm-clang; problem pointed out by Amit Kulkarniguenther2010-12-311-2/+2
|
* Sync with amd64, to allow this to compile without warnings with gcc4:miod2010-12-031-5/+5
| | | | | | ``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@
* there is no library function called sched_prio(), so this manual pagederaadt2010-11-072-6/+5
| | | | | was incorrectly named. there should be no sched_prio(3) page; it is misleading.
* do not list MLINKed man pages multiple times in SEE ALSO;jmc2010-11-071-3/+2
|
* tweak previous;jmc2010-11-071-3/+5
|
* Add sched_get_priority_{min,max}. tested in a bulk by landry@.fgsch2010-11-076-9/+133
| | | | input and ok from phessler@ and guenther@
* Change basep parameter of getdirentries() to be off_t *, not long *millert2010-10-283-6/+6
| | | | | | | | so it works correctly with large offsets (and matches other systems). This requires adding a new getdirentries syscall, with the old one renamed to ogetdirentries. All in-tree consumers of getdirentries() have been updated. Bump libc and libpthread major numbers. OK and with deraadt@
* Fix PR 6417: if we're starting a thread and there's no other threadsguenther2010-07-131-2/+3
| | | | | | | running, then we need to start a gc thread...except when this is the very call to start a gc thread! "This works for me" marc@
* Fix PR 6376: restore more thread library state if execve fails,guenther2010-07-133-46/+55
| | | | | | | including the scheduling timer, sigmask, fd nonblocking status, and handling of the signals used by the thread library. ok marc@, additional testing by ajacoutot@
* After forking, clear the 'thread joining this one' pointer in the child,guenther2010-07-121-1/+4
| | | | | | as the child only has the one thread remaining. ok marc@
* Use __attribute__ ((aligned (16)), to make sure the FPU state is alignedkettenis2010-06-301-3/+3
| | | | | | | | | on a 128-bit boundary like we do on amd64. The padding within the struct made sure the state was properly aligned *within* the struct, but since the alignment restriction on the struct itself was only 64-bit, the required alignment was not guaranteed. We just got lucky. ok oga@, guenther@
* Instead of (manually) closing the _thread_kern_pipe before callingguenther2010-06-272-6/+20
| | | | | execve(), just set the close-on-exec flag. Fixes PRs 6183 and 6376. ok marc@, "seems clearly better" tedu@
* Make sure that we really mark the FPU registers clean.kettenis2010-05-251-2/+2
| | | | ok deraadt@
* document when the _timed{rd,wr}lock functions first appeared; from bradjmc2010-05-032-4/+12
| | | | ok guenther
* Add support for pthread_rwlock_timed locks.tedu2010-04-126-27/+118
| | | | from brad. ok kurt, who's too busy to commit
* Use MACHINE_CPU instead of MACHINE_ARCH to pick the correct machine dependentmiod2010-02-032-7/+7
| | | | | | | 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@
* Make SO_RCVTIMEO and SO_SNDTIMEO work with pthreads. Fixes at least some offgsch2010-01-0313-38/+128
| | | | | the issues seen with www/varnish. With input and help from guenther@ and kurt@. guenther@ ok
* Make internal file descriptor handling async-signal safe by eliminatingkurt2009-12-0611-83/+124
| | | | | | the use of spinlocks and malloc. All needed memory is allocated upfront and _thread_kern_sig_defer/undefer() is now used to protect critical sections. okay guenther@
* Fix the handle locking in stdio to use flockfile/funlockfilekurt2009-11-091-131/+122
| | | | | | | | | | | | | internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. committing on behalf of and okay guenther@ now that we have install media space available.
* Remove mutext from list of held mutexes in _mutex_reinit(). Correctskurt2009-10-281-2/+9
| | | | | a failure to lock the _atfork_mutex after forking. Tested by ajacoutot@ and myself. okay guenther@
* - bump the majors of libpthread and librthread, as they used to return anjasper2009-10-271-2/+2
| | | | | | aliased ENOTSUP. i should've done this earlier, but missed it. my bad. as discussed with deraadt@ guenther@
* define ENOTSUP EOPNOTSUPP is no longer neededderaadt2009-10-271-6/+1
|
* Back out previous commit, as it caused too much growth for the installguenther2009-10-221-122/+131
| | | | media to fit
* Change libpthread's f*lockfile() routines to stop acting as no-opsguenther2009-10-211-131/+122
| | | | | | | | | for FILEs that don't have real file-descriptors: the fake FILEs used internally by snprintf/asprintf/vfprintf and friends now avoid unnecessary locking by calling the internal __vfprintf() routine directly and we do want to do locking on FILEs created with funopen(). ok kurt@
* After forking, the child is single threaded, so tell libc that. Thisguenther2009-10-211-1/+4
| | | | | | is needed to avoid deadlocks in popen() on FILE locking. ok kurt@
* - add a symbol to help gdb location pthread internals (_thread_ctx_offset)kurt2009-07-252-2/+3
| | | | ok kettenis@
* Use the md atomic code on mips64 instead of the horrid slow code. Should havemiod2009-06-011-5/+1
| | | | been noticed much time ago, but better late than never.
* A much better atomic lock routine.miod2009-06-011-43/+9
|
* Correct the _atomic_lock() asm so that gcc accepts the constraintsguenther2009-06-011-4/+4
| | | | | | when compiling without optimization; fix copied from the kernel's atomic.h ok miod@
* Increase default thread stack size to 256K on 32bit archs and 512K onkurt2009-04-211-2/+7
| | | | | 64bit archs to accommodate the growing number of ports that put large buffers on the stack. Supported by many with no objections.
* honor MSG_DONTWAITjakemsr2009-04-112-2/+4
| | | | ok marc@, guenther@
* these are public domain, verified with author; spotted by jjderaadt2009-02-151-1/+4
|
* Add pthread_attr_[sg]etguardsize() to match rthread, including manpagesguenther2008-12-1818-39/+269
| | | | | | Bump lib minor ok otto@ kurt@ marc@; doc review by jmc@
* Fix PR #5942: preserve errno across fd flag updates, so that successfulderaadt2008-10-021-1/+4
| | | | | | | calls to close(), closefrom(), and dup2() don't change it. ok tedu@, deraadt@, kurt@, millert@, art@, marco@ (miscommit: originally by guenther@)
* the license on this is PD; david leonard says soderaadt2008-10-025-5/+14
|
* Assert my copyright on files I gave to d@ back in 1998.drahn2008-10-011-1/+17
|
* Application-specified thread stacks didn't work with libpthreadguenther2008-07-071-11/+7
| | | | | | | because it treated the supplied memory as holding an internal data structure instead of as the stack space itself ok kurt@, "looks ok" otto@, tested on hppa by kettenis@
* - correct .Dt for pthread_attr_setstack.3jmc2008-07-053-6/+8
| | | | - new sentence, new line
* Add manpage for pthread_attr_[sg]etstack(3)guenther2008-07-058-21/+133
| | | | | Correct misnaming in STANDARDS section ok brad@ otto@
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-8/+1
| | | | | | | | | Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
* Move _POSIX_THREAD_SAFE_FUNCTIONS into unistd.h and set it to 200112millert2008-06-251-2/+1
| | | | | now that we support all the _r functions required by POSIX 1003.1-2001. Also define _POSIX_REENTRANT_FUNCTIONS. OK kurt@ deraadt@
* Adjust the _SEM_CHECK_VALIDITY macro to detect NULL sem_t instead ofkurt2008-06-201-2/+4
| | | | | | segfaulting. okay marc@ todd@
* zap last thread_malloc_init reference. otto@ okfgsch2008-06-141-2/+1
|
* remove _MALLOC_LOCK_INIT; major bump; ok deraadt@otto2008-06-132-7/+2
|
* Don't grab the fd read lock for getsockopt(2), setsockopt(2),kurt2008-06-034-18/+66
| | | | | | | | getpeername(2) or getsockname(2). Its not needed and causes threads to block when another thread is blocked and holding the read lock. Instead just protect against fd state transitions. Blocking problem reported by David S H Rosenthal from lockss.org okay beck@ "looks sane" deraadt@