summaryrefslogtreecommitdiff
path: root/lib/libc_r/uthread
Commit message (Collapse)AuthorAgeFilesLines
* Remove libc_r threading library. It has been disconnected from the buildEd Maste2010-11-13139-19451/+0
| | | | | | | | | for four years (since r162846). Submitted by: Alexander Best arundel@ Notes: svn path=/head/; revision=215269
* Fix leak of kqueue() file descriptors when linked with staticDaniel Eischen2009-02-081-0/+1
| | | | | | | | | | libc_r. PR: 58687 Submitted by: Jonathon Lennox <lennox at cs dot columbia dot edu> Notes: svn path=/head/; revision=188300
* Call the fcntl compatiblity wrapper from the thread library fcntl wrappersDoug Rabson2008-05-301-1/+3
| | | | | | | | | so that they get the benefit of the (limited) forward ABI compatibility. MFC after: 1 week Notes: svn path=/head/; revision=179434
* Fix some "in in" typos in comments.Christian Brueffer2008-03-261-1/+1
| | | | | | | | | | PR: 121490 Submitted by: Anatoly Borodin <anatoly.borodin@gmail.com> Approved by: rwatson (mentor), jkoshy MFC after: 3 days Notes: svn path=/head/; revision=177626
* Remove 3rd clause, renumber, ok per emailWarner Losh2007-01-1285-340/+85
| | | | Notes: svn path=/head/; revision=165967
* Backout unblocking of signal if no threads can currently handle it.Tor Egge2006-10-141-3/+2
| | | | | | | | The check for pending signal after direct invocation of signal handler is sufficient. Notes: svn path=/head/; revision=163336
* Delay unblocking signal and restoring process signal mask until theTor Egge2006-10-131-19/+41
| | | | | | | | | | | | thread signal mask has been updated to avoid stack overflow during signal bursts. Don't block signal forever if no threads can currently handle signal. Check for pending signal after direct invocation of signal handler. Notes: svn path=/head/; revision=163323
* Delay setting wakeup time until after poll array has been allocated.Tor Egge2006-10-131-20/+20
| | | | | | | Blocking on the malloc spinlock would cause the select timeout to be lost. Notes: svn path=/head/; revision=163322
* Sync thread jump table with libc and other thread libraries.Tor Egge2006-10-131-4/+35
| | | | Notes: svn path=/head/; revision=163321
* - Prefix MUTEX_TYPE_MAX with PTHREAD_ to avoid namespace pollution.Stefan Farfeleder2005-08-192-3/+3
| | | | | | | | | - Remove the macros MUTEX_TYPE_FAST and MUTEX_TYPE_COUNTING_FAST. OK'ed by: deischen Notes: svn path=/head/; revision=149298
* Mark _thread_exit() and __sys_exit() as __dead2 to quiet some warnings.John Baldwin2005-05-311-2/+2
| | | | Notes: svn path=/head/; revision=146831
* Style tweak.John Baldwin2005-05-311-1/+2
| | | | Notes: svn path=/head/; revision=146830
* Provide more POSIX-complaint ttyname_r(3) interface[1], which is slightlyXin LI2005-05-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | different from what has been offered in libc_r (the one spotted in the original PR which is found in libthr has already been removed by David's commit, which is rev. 1.44 of lib/libthr/thread/thr_private.h): - Use POSIX standard prototype for ttyname_r, which is, int ttyname_r(int, char *, size_t); Instead of: char *ttyname_r(int, char *, size_t); This is to conform IEEE Std 1003.1, 2004 Edition [1]. - Since we need to use standard errno for return code, include errno.h in ttyname.c - Update ttyname(3) implementation according to reflect the API change. - Document new ttyname_r(3) behavior - Since we already make use of a thread local storage for ttyname(3), remove the BUGS section. - Remove conflicting ttyname_r related declarations found in libc_r. Hopefully this change should not have changed the API/ABI, as the ttyname_r symbol was never introduced before the last unistd.h change which happens a couple of days before. [1] http://www.opengroup.org/onlinepubs/009695399/functions/ttyname.html Requested by: Tom McLaughlin <tmclaugh sdf lonestar org> Through PR: threads/76938 Patched by: Craig Rodrigues <rodrigc crodrigues org> (with minor changes) Prompted by: mezz@ Notes: svn path=/head/; revision=146186
* Increase the default stacksizes:Joe Marcus Clarke2005-02-283-20/+30
| | | | | | | | | | | | 32-bit 64-bit main thread 2 MB 4 MB other threads 1 MB 2 MB Adapted from: libpthread Approved by: deischen Notes: svn path=/head/; revision=142808
* More fixes to the copyright notice.Jeffrey Hsu2005-01-082-2/+2
| | | | | | | Submitted by: Ken Smith <kensmith@cse.Buffalo.EDU> Notes: svn path=/head/; revision=139908
* Fix copyright notice.Jeffrey Hsu2005-01-082-2/+2
| | | | Notes: svn path=/head/; revision=139890
* Add pthread_atfork().Greg Lehey2004-12-105-1/+92
| | | | | | | | PR: bin/68841 Submitted by: Dan Nelson <dnelson@allantgroup.com> Notes: svn path=/head/; revision=138646
* Don't include sys/user.h merely for its side-effect of recursivelyDavid Schultz2004-11-274-3/+5
| | | | | | | including other headers. Notes: svn path=/head/; revision=138129
* Avoid using void pointers in additive expressions.Stefan Farfeleder2004-08-142-2/+5
| | | | | | | PR: 56653 Notes: svn path=/head/; revision=133723
* Initialize the (i386) frame pointer when setting up a threadDaniel Eischen2004-01-221-1/+4
| | | | | | | | | | context. Submitted by: Marc Olzheim <marcolz@stack.nl> Tested by: Marc Olzheim <marcolz@stack.nl> Notes: svn path=/head/; revision=124841
* MFlibpthread: Add a simple work-around for deadlocking on recursiveDaniel Eischen2004-01-082-44/+82
| | | | | | | readlocks on a rwlock while there are writers waiting. Notes: svn path=/head/; revision=124253
* Reenable signals for threads after joining.Daniel Eischen2003-12-311-0/+3
| | | | | | | Submitted by: Marc Olzheim <marcolz@stack.nl> Notes: svn path=/head/; revision=124018
* Return to the caller if write() returns 0.Daniel Eischen2003-12-171-0/+2
| | | | | | | PR: 59291 Notes: svn path=/head/; revision=123610
* For the amd64 we need to do some extra stack alignment fixups. OtherwisePeter Wemm2003-12-033-6/+27
| | | | | | | | | | | | we can end up with some threads with a non-16-byte-aligned stack. This causes some interesting side effects, including general protection faults leading to a SIGBUS when doing floating point or varargs. This should be just a verbose NOP for the other platforms. Approved by: re (scottl) Notes: svn path=/head/; revision=123117
* If __sys_write() returns 0, allow that to exit the loop in libc_r'sDaniel Eischen2003-09-291-2/+2
| | | | | | | | | wrapped version of write(). Submitted by: dan@langille.org Notes: svn path=/head/; revision=120575
* Add wrapper for kqueue() to keep track of the allocated fd and allow it toMark Peek2003-07-252-0/+54
| | | | | | | | | | be closed. This fixes a file descriptor leak when closing a kqueue() fd. Reviewed by: deischen MFC after: 1 week Notes: svn path=/head/; revision=118019
* Sanity check fd before using it as an array index.Alexander Leidinger2003-06-091-1/+2
| | | | | | | | Noticed by: ted@NLnetLabs.nl (Ted Lindgreen) Approved by: ru Notes: svn path=/head/; revision=116092
* Port libc_r to amd64, and turn it back on for amd64. It passes all ofPeter Wemm2003-06-021-0/+18
| | | | | | | the same src/lib/libc_r/test/* tests that the other platforms pass. Notes: svn path=/head/; revision=115740
* Fixed another bug in the threaded close() call; clear theRuslan Ermilov2003-05-311-0/+4
| | | | | | | | | | | | stale stdio descriptors flags. PR: bin/51535 Submitted by: Enache Adrian <enache@rdslink.ro> Reviewed by: deischen Approved by: re (scottl) Notes: svn path=/head/; revision=115422
* If an application closes one of its stdio descriptors (0..2),Ruslan Ermilov2003-05-311-2/+4
| | | | | | | | | | | | | | | | | | | | an excessive close() on one of these descriptors would cause a memory for this descriptor to be allocated in the internal descriptor table. When this descriptor gets used again, e.g. through the call to open() or socket(), the descriptor would be erroneously left in the blocking mode, and the whole application would get stuck on a blocking operation, e.g., in accept(2). Prevent this bug from happening by disallowing close() against non-active descriptors (return -1 and set errno to EBADF in this case). Reviewed by: deischen Approved by: re (scottl) Notes: svn path=/head/; revision=115421
* Add stub implementations of pthread_[gs]etconcurrency to libc_r andJohn Polstra2003-04-202-0/+61
| | | | | | | | | | | | libthr. No changes were made to libpthread by request of deischen, who will soon commit a real implementation for that library. PR: standards/50848 Submitted by: Sergey A. Osokin <osa@freebsd.org.ru> MFC after: 1 week Notes: svn path=/head/; revision=113729
* - Define a _spinunlock() function so that threading implementations may doJeff Roberson2003-03-261-0/+6
| | | | | | | | | more complicated things than just setting the lock to 0. - Implement stubs for this function in libc and the two threading libraries that are currently in the tree. Notes: svn path=/head/; revision=112665
* Fix threaded applications on ia64 that are linked dynamicly. We didMarcel Moolenaar2003-03-051-0/+1
| | | | | | | | | | | | | | | | | | | | not save (restore) the global pointer (GP) in the jmpbuf in setjmp (longjmp) because it's not needed in general. GP is considered a scratch register at callsites and hence is always restored after a call (when it's possible that the call resolves to a symbol in a different loadmodule; otherwise GP does not have to be saved and restored at all), including calls to setjmp/longjmp. There's just one problem with this now that we use setjmp/longjmp for context switching: A new context must have GP defined properly for the thread's entry point. This means that we need to put GP in the jmpbuf and consequently that we have to restore is in longjmp. This automaticly requires us to save it as well. When setjmp/longjmp isn't used for context switching, this can be reverted again. Notes: svn path=/head/; revision=111897
* Don't cast an int to a pointer type without (possibly) widening theMarcel Moolenaar2003-03-051-1/+1
| | | | | | | | | | | | | | integral type to the size of a pointer type when it's known that the cast is valid. On ia64 such casts are generally bad news and has led us (=peter :-) to make such casts fatal. By casting to intptr_t before casting to a pointer type, this now compiles cleanly in LP64 architectures. Note that the final cast has been changed to void* (instead of siginfo_t*) to make it explicit that we're not trying to pass a siginfo_t pointer but rather trying to pass an int when the prototype says it should be a pointer. Notes: svn path=/head/; revision=111896
* Actually link in the attr_{set,get}stack.Alfred Perlstein2003-02-111-0/+2
| | | | Notes: svn path=/head/; revision=110677
* Add pthread_attr_getstack() and pthread_attr_setstack().Alfred Perlstein2003-02-102-0/+117
| | | | | | | Submitted by: Craig Rodrigues <rodrigc@attbi.com> Notes: svn path=/head/; revision=110636
* Improve pthread_attr_get_np() by enabling it to return thread's real stackAlexey Zelkin2003-02-031-1/+9
| | | | | | | | | address instead of specified by pthread_attr_t passed to pthread_create(). Suggested by: deischen Notes: svn path=/head/; revision=110276
* Increase the scheduler stack to 4 pages. This should prevent a stackDaniel Eischen2003-01-111-1/+1
| | | | | | | | | overflow when dumping thread info (generated by receipt of SIGINFO). Reported by: jmallet Notes: svn path=/head/; revision=109085
* pthread_attr_get_np() now takes 'pthread_t' (not 'pthread_t *')Max Khon2003-01-071-7/+6
| | | | | | | to be consistent with other pthread_XXX functions Notes: svn path=/head/; revision=108898
* Port libc_r to ia64. We need to do things slightly differentMarcel Moolenaar2003-01-064-0/+44
| | | | | | | | | | | | | | because we have 2 stacks per thread: the regular downward memory stack and the irregular upward register stack. This implementation lets both stacks grow toward each other. An alternative scheme is to have them grow away from each other. The alternate scheme has the advantage that both stack grow toward guard pages. Since libc_r is virtually dead and we really want the *context stuff for thread switching, we don't try to be perfect, just functional. Notes: svn path=/head/; revision=108753
* Add MD definitions for sparc64. This is based on work by des.Thomas Moestl2003-01-051-0/+29
| | | | Notes: svn path=/head/; revision=108740
* Fix typos in comment.Daniel Eischen2002-12-281-2/+2
| | | | | | | Submitted by: Craig Rodrigues <rodrigc@attbi.com> Notes: svn path=/head/; revision=108340
* Make accept(), connect(), recvfrom(), recvmsg(), sendmsg(),Ruslan Ermilov2002-12-196-6/+80
| | | | | | | | | and sendto() cancelation points, as required by POSIX.1-2001. Reviewed by: deischen Notes: svn path=/head/; revision=108092
* When about to do an execve(), don't reset the O_NONBLOCK flag on any fileArchie Cobbs2002-11-151-0/+4
| | | | | | | | | | | | descriptors that have the close-on-exec flag set, as that will have no effect anyway and might screw something else up if the file descriptor happens to be shared with another process. PR: standards/43335 MFC after: 1 week Notes: svn path=/head/; revision=106943
* At initialization, override the pthread stub routines in libcDaniel Eischen2002-11-1319-136/+245
| | | | | | | | | | | | by filling in the jump table. Convert uses of pthread routines within libc_r to use the internal versions (_pthread_foo instead of pthread_foo). Remove a couple of globals from application namespace. Notes: svn path=/head/; revision=106867
* Fix bogus return values from libc_r's writev() routine in situations whereArchie Cobbs2002-11-121-6/+21
| | | | | | | | | | a partial-write is followed by an error. PR: 43335 MFC after: 3 days Notes: svn path=/head/; revision=106820
* Fix bogus return values from libc_r's write() routine in situations whereArchie Cobbs2002-11-051-6/+21
| | | | | | | | | | a partial-write is followed by an error. PR: 43335 MFC after: 1 week Notes: svn path=/head/; revision=106434
* Use the strong symbol'd version of pthread_mutex_init so we don'tDaniel Eischen2002-10-311-2/+2
| | | | | | | | | | accidentally call a stub or application provided version of the same routine. Submitted by: dfr Notes: svn path=/head/; revision=106256
* Hook uthread_attr_get_np.c to buildAlexey Zelkin2002-10-261-0/+1
| | | | Notes: svn path=/head/; revision=105986
* Add pthread_attr_get_np() function. This is FreeBSD non-portable POSIX threadsAlexey Zelkin2002-10-261-0/+50
| | | | | | | | | | | | extenston function. It supposed to provide facility to get already created thread's attributes. Looks like it's last thing we need to make JDK's Hotspot building without requirement to have source tree. Reviewed by: deischen MFC after: 3 days Notes: svn path=/head/; revision=105985