summaryrefslogtreecommitdiff
path: root/lib/libpthread
Commit message (Collapse)AuthorAgeFilesLines
* Have a single set of POSIX threads man pages. The LIBRARY sectionRuslan Ermilov2004-01-1450-4732/+0
| | | | | | | | | | | of each manpage lists libraries that have corresponding interfaces implemented. Prodded by: threads Reviewed by: deischen Notes: svn path=/head/; revision=124535
* Add a simple work-around for deadlocking on recursive read locksDaniel Eischen2004-01-083-48/+86
| | | | | | | | | | | | | on a rwlock while there are writers waiting. We normally favor writers but when a reader already has at least one other read lock, we favor the reader. We don't track all the rwlocks owned by a thread, nor all the threads that own a rwlock -- we just keep a count of all the read locks owned by a thread. PR: 24641 Notes: svn path=/head/; revision=124252
* Kernel now supports per-thread sigaltstack, follow the change toDavid Xu2004-01-031-6/+1
| | | | | | | enable sigaltstack for scope system thread. Notes: svn path=/head/; revision=124095
* Return error code in errno, not in return value.David Xu2004-01-021-3/+6
| | | | Notes: svn path=/head/; revision=124056
* Fix a typo.David Xu2004-01-021-1/+1
| | | | Notes: svn path=/head/; revision=124055
* Removed MLINKS to nonimplemented/nonexistent functions.Ruslan Ermilov2003-12-301-3/+0
| | | | Notes: svn path=/head/; revision=124000
* Merge from libc_r: document pthread_attr_[gs]etstack().Ruslan Ermilov2003-12-302-1/+11
| | | | Notes: svn path=/head/; revision=123999
* Pull some changes (mostly cosmetic) from libc_r manpagesRuslan Ermilov2003-12-3030-75/+143
| | | | | | | in preparation for the merge. Notes: svn path=/head/; revision=123995
* Forgot to commit this file for last commit. :(David Xu2003-12-291-0/+4
| | | | Notes: svn path=/head/; revision=123975
* Implement sigaltstack() as per-threaded. Current only scope process threadDavid Xu2003-12-295-24/+233
| | | | | | | | | | | is supported, for scope system process, kernel signal bits need to be changed. Reviewed by: deischen Tested on : i386 amd64 ia64 Notes: svn path=/head/; revision=123974
* Correctly retrieve sigaction flags.David Xu2003-12-281-2/+2
| | | | Notes: svn path=/head/; revision=123933
* Replace a comment with more accurated one, memory heap is now protected byDavid Xu2003-12-191-3/+2
| | | | | | | new fork() wrapper. Notes: svn path=/head/; revision=123668
* Code clean up, remove unused MACROS and function prototypes.David Xu2003-12-191-18/+0
| | | | Notes: svn path=/head/; revision=123666
* accept() returns a file descriptor when it succeeds which is veryDaniel Eischen2003-12-092-2/+2
| | | | | | | | | | | | likely to be non-zero. When leaving the cancellation point, check the return value against -1 to see if cancellation should be checked. While I'm here, make the same change to connect() just to be consisitent. Pointed out by: davidxu Notes: svn path=/head/; revision=123365
* Remove an unused struct definition.Daniel Eischen2003-12-091-12/+0
| | | | Notes: svn path=/head/; revision=123356
* Add cancellation points for accept() and connect().Daniel Eischen2003-12-095-0/+106
| | | | Notes: svn path=/head/; revision=123355
* Use mutex instead of low level thread lock to implement spinlock, thisDavid Xu2003-12-091-30/+18
| | | | | | | avoids signal to be blocked when otherwise it can be handled. Notes: svn path=/head/; revision=123314
* Rename _thr_enter_cancellation_point to _thr_cancel_enter, renameDavid Xu2003-12-0930-136/+148
| | | | | | | | | | | | | | | | | | | | | | | | _thr_leave_cancellation_point to _thr_cancel_leave, add a parameter to _thr_cancel_leave to indicate whether cancellation point should be checked, this gives us an option to not check cancallation point if a syscall successfully returns to avoid any leaks, current I have creat(), open() and fcntl(F_DUPFD) to not check cancellation point after they sucessfully returned. Replace some members in structure kse with bit flags to same some memory. Conditionally compile THR_ASSERT to nothing if _PTHREAD_INVARIANTS is not defined. Inline some small functions in thr_cancel.c. Use __predict_false in thr_kern.c for some executed only once code. Reviewd by: deischen Notes: svn path=/head/; revision=123312
* More reliably check timeout for pthread_mutex_timedlock.David Xu2003-12-091-1/+1
| | | | Notes: svn path=/head/; revision=123310
* Go back to using rev 1.18 where thread locks are used instead of KSEDaniel Eischen2003-12-081-17/+16
| | | | | | | | | | locks for [libc] spinlock implementation. This was previously backed out because it exposed a bug in ia64 implementation. OK'd by: marcel Notes: svn path=/head/; revision=123297
* Simplify the contexts created by the kernel and remove the relatedMarcel Moolenaar2003-12-071-0/+6
| | | | | | | | | | | | flags. We now create asynchronous contexts or syscall contexts only. Syscall contexts differ from the minimal ABI dictated contexts by having the scratch registers saved and restored because that's where we keep the syscall arguments and syscall return values. Since this change affects KSE, have it use kse_switchin(2) for the "new" syscall context. Notes: svn path=/head/; revision=123255
* Apply a second fix for stack alignment with libkse. This time, enter thePeter Wemm2003-12-051-2/+2
| | | | | | | | | | | | | | UTS with the stack correctly aligned. Also, while here, use an indirect jump rather than the pushq/ret hack. This fixes threaded apps that use floating point for me, although it hasn't solved all the problems. It is an improvement though. Preservation of the 128 byte red zone hasn't been resolved yet. Approved by: re (scottl) Notes: svn path=/head/; revision=123155
* Eliminate two pushl by using call instruction directly, this reallyDavid Xu2003-11-291-2/+1
| | | | | | | | | helps branch predict a lot for INTEL P4. Approved by: re (scottl) Notes: svn path=/head/; revision=123049
* 1.Macro optimizing KSE_LOCK_ACQUIRE and THR_LOCK_ACQUIRE to use static fallDavid Xu2003-11-292-99/+31
| | | | | | | | | | | | | | | | | through branch predict as suggested in INTEL IA32 optimization guide. 2.Allocate siginfo arrary separately to avoid pthread to be allocated at 2K boundary, which hits L1 address alias problem and causes context switch to be slow down. 3.Simplify context switch code by removing redundant code, code size is reduced, so it is expected to run faster. Reviewed by: deischen Approved by: re (scottl) Notes: svn path=/head/; revision=123048
* Remove surplus mmap() call for stack guard page in init_private, it is doneDavid Xu2003-11-291-25/+0
| | | | | | | | | | | in init_main_thread. Also don't initialize lock and lockuser again for initial thread, it is already done by _thr_alloc(). Reviewed by: deischen Approved by: re (scottl) Notes: svn path=/head/; revision=123047
* Back out last change and go back to using KSE locks instead of threadDaniel Eischen2003-11-161-16/+17
| | | | | | | | | locks until we know why this breaks ia64. Reported by: marcel Notes: svn path=/head/; revision=122801
* If a thread in critical region got a synchronous signal, according currentDavid Xu2003-11-091-0/+2
| | | | | | | | | signal handling mode, there is no chance to handle the signal, something must be wrong in the library, just call kse_thr_interrupt to dump its core. I have the code for a long time, but forgot to commit it. Notes: svn path=/head/; revision=122338
* Use THR lock instead of KSE lock to avoid scheduler be blocked in spinlock.David Xu2003-11-081-17/+16
| | | | | | | Reviewed by: deischen Notes: svn path=/head/; revision=122299
* style(9)Daniel Eischen2003-11-051-40/+53
| | | | | | | Reviewed by: bde Notes: svn path=/head/; revision=122131
* Don't declare the malloc lock; use the declaration provided in libc.Daniel Eischen2003-11-051-1/+6
| | | | | | | Noticed by: bde Notes: svn path=/head/; revision=122130
* Add pthread_atfork() source code. Dan forgot to commit this file.David Xu2003-11-051-0/+56
| | | | Notes: svn path=/head/; revision=122089
* Add an implementation for pthread_atfork().Daniel Eischen2003-11-046-6/+73
| | | | | | | | | | | Aside from the POSIX requirements for pthread_atfork(), when fork()ing, take the malloc lock to keep malloc state consistent in the child. Reviewed by: davidxu Notes: svn path=/head/; revision=122075
* Add the ability to reinitialize libpthread's internal FIFO-queueingDaniel Eischen2003-11-042-15/+57
| | | | | | | | | locks. Reviewed by: davidxu Notes: svn path=/head/; revision=122074
* Add the ability to reinitialize a spinlock (libc/libpthreadDaniel Eischen2003-11-041-12/+17
| | | | | | | | | internal lock, not a pthread spinlock). Reviewed by: davidxu Notes: svn path=/head/; revision=122073
* s/foo()/foo(void)/Daniel Eischen2003-11-041-2/+3
| | | | | | | Add a blank line after a variable declaration. Notes: svn path=/head/; revision=122072
* Libpthread uses the convention that all of its (non-weak) symbolsDaniel Eischen2003-11-041-5/+11
| | | | | | | | begin with underscores and provide weak definitions without underscores. Make the pthread spinlock conform to this convention. Notes: svn path=/head/; revision=122071
* Add the ability to reinitialize a mutex (internally, not a userlandDaniel Eischen2003-11-041-7/+20
| | | | | | | | | API). Reviewed by: davidxu Notes: svn path=/head/; revision=122070
* Use amd64_set_fsbase() instead of calling sysarch() directly.Peter Wemm2003-10-231-6/+1
| | | | Notes: svn path=/head/; revision=121409
* This test relies on the concurrency level being 1; make it so.Daniel Eischen2003-10-201-0/+3
| | | | Notes: svn path=/head/; revision=121266
* Update context code for my last ABI breakage of mcontext. I'm worriedPeter Wemm2003-10-171-7/+8
| | | | | | | | | | about the fpu code here. It should be using fxsave/fxrstor instead of saving/restoring the control word. The SSE registers are used a lot in gcc generated code on amd64. I'm not sure how this all fits together though. Notes: svn path=/head/; revision=121163
* Don't forget to initialize the fake tcb when the kcb is allocated.Daniel Eischen2003-10-121-0/+3
| | | | Notes: svn path=/head/; revision=121043
* Reverse the order of the first two arguments to _sparc64_enter_uts().Daniel Eischen2003-10-091-2/+2
| | | | | | | | The first argument is the UTS function, the second argument is the first argument to the UTS function. Who's on first. Notes: svn path=/head/; revision=120956
* Convert a couple of hardcoded values to constants. Make thr_getcontext()Daniel Eischen2003-10-092-3/+7
| | | | | | | | return 0 when called the first time, and return 1 when resumed by thr_setcontext(). Notes: svn path=/head/; revision=120939
* Add preliminary sparc64 support to libpthread. This does notDaniel Eischen2003-10-096-0/+509
| | | | | | | | | | | yet work, but hopefully someone familiar with the sparc64 port can pick up the reins. Submitted by: jake With mods by: deischen Notes: svn path=/head/; revision=120924
* Fix some comments for last commit.David Xu2003-10-081-5/+4
| | | | Notes: svn path=/head/; revision=120897
* Complete cancellation support for M:N threads, check cancelling flag whenDavid Xu2003-10-082-69/+157
| | | | | | | | | | thread state is changed from RUNNING to WAIT state and do some cancellation operations for every cancellable state. Reviewed by: deischen Notes: svn path=/head/; revision=120896
* Use thread lock instead of scheduler lock to eliminate lock contentionDavid Xu2003-10-081-18/+21
| | | | | | | | | for all wrapped syscalls under SMP. Reviewed by: deischen Notes: svn path=/head/; revision=120895
* Fix a logic error; use beq to check for a register being NULL, not bne.Daniel Eischen2003-10-021-1/+1
| | | | Notes: svn path=/head/; revision=120675
* Correct the library name.Ruslan Ermilov2003-10-021-1/+1
| | | | Notes: svn path=/head/; revision=120672
* - Remove error code that can't be returned (and original descriptionKen Smith2003-10-021-2/+0
| | | | | | | | | | | was not proper English) PR: docs/57434 Approved: blackend (mentor) Reviewed by: deischen Notes: svn path=/head/; revision=120670