summaryrefslogtreecommitdiff
path: root/lib/libpthread
Commit message (Collapse)AuthorAgeFilesLines
...
* Macro optimize, this increases context switch speed about 2% on myDavid Xu2004-07-311-2/+2
| | | | | | | athlon64 machine. Notes: svn path=/head/; revision=132913
* PPC MD bits for KSE. Runs test cases OK. Crippled to 1:1 mode forPeter Grehan2004-07-198-0/+820
| | | | | | | the time being. Notes: svn path=/head/; revision=132400
* Don't include lock.h and pthread_md.h when we're being included byMarcel Moolenaar2004-07-181-0/+2
| | | | | | | libthread_db. Both headers are included seperately. Notes: svn path=/head/; revision=132333
* Copy lwp id to thread mailbox.David Xu2004-07-141-0/+1
| | | | Notes: svn path=/head/; revision=132128
* Call kse_switchin to switch context when being debugged.David Xu2004-07-135-31/+89
| | | | Notes: svn path=/head/; revision=132125
* Remove unused symbols.David Xu2004-07-131-14/+0
| | | | Notes: svn path=/head/; revision=132124
* Export necessary symbols to debugger.David Xu2004-07-131-7/+4
| | | | Notes: svn path=/head/; revision=132123
* Let debugger check signal, make SIGINFO works.David Xu2004-07-131-12/+25
| | | | Notes: svn path=/head/; revision=132122
* If _libkse_debug is not zero, activate thread mode.David Xu2004-07-131-0/+6
| | | | Notes: svn path=/head/; revision=132121
* Add code to support thread debugging.David Xu2004-07-135-44/+146
| | | | | | | | | | | | | | | | | | 1. Add global varible _libkse_debug, debugger uses the varible to identify libpthread. when the varible is written to non-zero by debugger, libpthread will take some special action at context switch time, it will check TMDF_DOTRUNUSER flags, if a thread has the flags set by debugger, it won't be scheduled, when a thread leaves KSE critical region, thread checks the flag, if it was set, the thread relinquish CPU. 2. Add pq_first_debug to select a thread allowd to run by debugger. 3. Some names prefixed with _thr are renamed to _thread prefix. which is allowed to run by debugger. Notes: svn path=/head/; revision=132120
* kse_switchin ABI was changed in kernel.David Xu2004-07-121-3/+2
| | | | Notes: svn path=/head/; revision=132021
* Check pending signals, if there is signal will be unblocked byDavid Xu2004-06-124-22/+25
| | | | | | | | | | | | | | | | | | | | | sigsuspend, thread shouldn't wait, in old code, it may be ignored. When a signal handler is invoked in sigsuspend, thread gets two different signal masks, one is in thread structure, sigprocmask() can retrieve it, another is in ucontext which is a third parameter of signal handler, the former is the result of sigsuspend mask ORed with sigaction's sa_mask and current signal, the later is the mask in thread structure before sigsuspend is called. After signal handler is called, the mask in ucontext should be copied into thread structure, and becomes CURRENT signal mask, then sigsuspend returns to user code. Reviewed by: deischen Tested by: Sean McNeil <sean@mcneil.com> Notes: svn path=/head/; revision=130374
* Avoid clobbering the red zone when running on the new context's stack inTim J. Robbins2004-06-071-0/+5
| | | | | | | _amd64_restore_context(). Notes: svn path=/head/; revision=130206
* Arm bits for libpthread. It has no chances to work and should be consideredOlivier Houchard2004-05-145-0/+471
| | | | | | | as stubs. Notes: svn path=/head/; revision=129206
* After forking and initializing the library to single-threadedDaniel Eischen2004-04-081-2/+3
| | | | | | | | | | | | | mode (where the forked thread is the one and only thread and is marked as system scope), set the system scope flag before initializing the signal mask. This prevents trying to use internal locks that haven't yet been initialized. Reported by: Dan Nelson <dnelson at allantgroup.com> Reviewed by: davidxu Notes: svn path=/head/; revision=128041
* Fix a POSIX conformance bug. POSIX says sigwait should return error numberDavid Xu2004-03-171-3/+3
| | | | | | | in return value not in errno. Notes: svn path=/head/; revision=127102
* Fixed a misspelling of 0 as NULL.Bruce Evans2004-03-141-1/+1
| | | | Notes: svn path=/head/; revision=126952
* style cleanup: Remove duplicate $FreeBSD$ tags.Colin Percival2004-02-101-2/+0
| | | | | | | | | | | These files had tags after teh copyright notice, inside the comment block (incorrect, removed), and outside the comment block (correct). Approved by: rwatson (mentor) Notes: svn path=/head/; revision=125669
* style cleanup: Remove duplicate $FreeBSD$ tags.Colin Percival2004-02-101-2/+0
| | | | | | | | | | | These files had tags after the copyright notice, inside the comment block (incorrect, removed), and outside the comment block (correct). Approved by: rwatson (mentor) Notes: svn path=/head/; revision=125668
* Add sem_timedwait to the symbol map, otherwise the libc version willDaniel Eischen2004-02-101-0/+2
| | | | | | | get used. Notes: svn path=/head/; revision=125636
* Add cancellation point to sem_wait() and sem_timedwait() for psharedDaniel Eischen2004-02-061-10/+18
| | | | | | | | | | | semaphores. Also add cancellation cleanup handlers to keep semaphores in a consistent state. Submitted in part by: davidxu Reviewed by: davidxu Notes: svn path=/head/; revision=125522
* libkse was renamed to libpthread.David Xu2004-02-051-1/+1
| | | | Notes: svn path=/head/; revision=125468
* Provide a userland version of non-pshared semaphores and add cancellationDaniel Eischen2004-02-032-169/+153
| | | | | | | points to sem_wait() and sem_timedwait(). Also make sem_post signal-safe. Notes: svn path=/head/; revision=125373
* Now that libpthread is the default threading library, remove theMarcel Moolenaar2004-01-311-12/+0
| | | | | | | | compatibility link from libc_r to libpthread (previously a link from libc_r to libkse). Notes: svn path=/head/; revision=125258
* Change libkse back to libpthread and make it the defaultDaniel Eischen2004-01-301-0/+4
| | | | | | | | | | | | | | thread library for i386, amd64, and ia64. For alpha and sparc64 the library is not changed and remains libkse, and links are installed so that libpthread -> libc_r. The gcc -pthread option will be changed in a separate commit so that it links to -lpthread instead of -lc_r. Approved by: re@ Notes: svn path=/head/; revision=125230
* Return EPERM if mutex owner is not current thread but it tries toDavid Xu2004-01-171-18/+3
| | | | | | | | | unlock the mutex, old code confuses some programs when it returns EINVAL. Noticed by: bland Notes: svn path=/head/; revision=124606
* 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