summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread
Commit message (Collapse)AuthorAgeFilesLines
...
* Pull debug symbols in for statically linked binary.davidxu2004-08-211-0/+4
| | | | Reviewed by: desichen
* 1. Add macro DTV_OFFSET to calculate dtv offset in tcb.davidxu2004-08-161-0/+1
| | | | 2. Export symbols needed by debugger.
* Add a file to collection all symbols will be needed by debugger.davidxu2004-08-161-0/+60
|
* Add TLS support for i386 and amd64.dfr2004-08-151-1/+1
|
* As long as we have a knob to force system scope threads, why not havedeischen2004-08-124-8/+13
| | | | | | | | | | | | | a knob to force process scope threads. If the environment variable LIBPTHREAD_PROCESS_SCOPE is set, force all threads to be process scope threads regardless of how the application creates them. If LIBPTHREAD_SYSTEM_SCOPE is set (forcing system scope threads), it overrides LIBPTHREAD_PROCESS_SCOPE. $ # To force system scope threads $ LIBPTHREAD_SYSTEM_SCOPE=anything threaded_app $ # To force process scope threads $ LIBPTHREAD_PROCESS_SCOPE=anything threaded_app
* Check debugger suspending flag for system scope thread.davidxu2004-08-081-3/+7
| | | | Reviewed by: deischen
* Add a way to force 1:1 mode for libpthread. To do this, definedeischen2004-08-075-42/+41
| | | | | | | | | | | LIBPTHREAD_SYSTEM_SCOPE in the environment. You can still force libpthread to be built in strictly 1:1 by adding -DSYSTEM_SCOPE_ONLY to CFLAGS. This is kept for archs that don't yet support M:N mode. Requested by: rwatson Reviewed by: davidxu
* s/TMDF_DONOTRUNUSER/TMDF_SUSPEND/gdavidxu2004-08-033-4/+4
| | | | Dicussed with: deischen
* Don't include lock.h and pthread_md.h when we're being included bymarcel2004-07-181-0/+2
| | | | libthread_db. Both headers are included seperately.
* Remove unused symbols.davidxu2004-07-131-14/+0
|
* Let debugger check signal, make SIGINFO works.davidxu2004-07-131-12/+25
|
* If _libkse_debug is not zero, activate thread mode.davidxu2004-07-131-0/+6
|
* Add code to support thread debugging.davidxu2004-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.
* Check pending signals, if there is signal will be unblocked bydavidxu2004-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>
* After forking and initializing the library to single-threadeddeischen2004-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
* Fix a POSIX conformance bug. POSIX says sigwait should return error numberdavidxu2004-03-171-3/+3
| | | | in return value not in errno.
* Fixed a misspelling of 0 as NULL.bde2004-03-141-1/+1
|
* style cleanup: Remove duplicate $FreeBSD$ tags.cperciva2004-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)
* Add cancellation point to sem_wait() and sem_timedwait() for pshareddeischen2004-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
* Provide a userland version of non-pshared semaphores and add cancellationdeischen2004-02-032-169/+153
| | | | points to sem_wait() and sem_timedwait(). Also make sem_post signal-safe.
* Return EPERM if mutex owner is not current thread but it tries todavidxu2004-01-171-18/+3
| | | | | | unlock the mutex, old code confuses some programs when it returns EINVAL. Noticed by: bland
* Add a simple work-around for deadlocking on recursive read locksdeischen2004-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
* Kernel now supports per-thread sigaltstack, follow the change todavidxu2004-01-031-6/+1
| | | | enable sigaltstack for scope system thread.
* Return error code in errno, not in return value.davidxu2004-01-021-3/+6
|
* Fix a typo.davidxu2004-01-021-1/+1
|
* Forgot to commit this file for last commit. :(davidxu2003-12-291-0/+4
|
* Implement sigaltstack() as per-threaded. Current only scope process threaddavidxu2003-12-294-24/+231
| | | | | | | | is supported, for scope system process, kernel signal bits need to be changed. Reviewed by: deischen Tested on : i386 amd64 ia64
* Correctly retrieve sigaction flags.davidxu2003-12-281-2/+2
|
* Replace a comment with more accurated one, memory heap is now protected bydavidxu2003-12-191-3/+2
| | | | new fork() wrapper.
* Code clean up, remove unused MACROS and function prototypes.davidxu2003-12-191-18/+0
|
* accept() returns a file descriptor when it succeeds which is verydeischen2003-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
* Remove an unused struct definition.deischen2003-12-091-12/+0
|
* Add cancellation points for accept() and connect().deischen2003-12-094-0/+102
|
* Use mutex instead of low level thread lock to implement spinlock, thisdavidxu2003-12-091-30/+18
| | | | avoids signal to be blocked when otherwise it can be handled.
* Rename _thr_enter_cancellation_point to _thr_cancel_enter, renamedavidxu2003-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
* More reliably check timeout for pthread_mutex_timedlock.davidxu2003-12-091-1/+1
|
* Go back to using rev 1.18 where thread locks are used instead of KSEdeischen2003-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
* 1.Macro optimizing KSE_LOCK_ACQUIRE and THR_LOCK_ACQUIRE to use static falldavidxu2003-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)
* Remove surplus mmap() call for stack guard page in init_private, it is donedavidxu2003-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)
* Back out last change and go back to using KSE locks instead of threaddeischen2003-11-161-16/+17
| | | | | | locks until we know why this breaks ia64. Reported by: marcel
* If a thread in critical region got a synchronous signal, according currentdavidxu2003-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.
* Use THR lock instead of KSE lock to avoid scheduler be blocked in spinlock.davidxu2003-11-081-17/+16
| | | | Reviewed by: deischen
* style(9)deischen2003-11-051-40/+53
| | | | Reviewed by: bde
* Don't declare the malloc lock; use the declaration provided in libc.deischen2003-11-051-1/+6
| | | | Noticed by: bde
* Add pthread_atfork() source code. Dan forgot to commit this file.davidxu2003-11-051-0/+56
|
* Add an implementation for pthread_atfork().deischen2003-11-045-6/+71
| | | | | | | | 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
* Add the ability to reinitialize a spinlock (libc/libpthreaddeischen2003-11-041-12/+17
| | | | | | internal lock, not a pthread spinlock). Reviewed by: davidxu
* s/foo()/foo(void)/deischen2003-11-041-2/+3
| | | | Add a blank line after a variable declaration.
* Libpthread uses the convention that all of its (non-weak) symbolsdeischen2003-11-041-5/+11
| | | | | begin with underscores and provide weak definitions without underscores. Make the pthread spinlock conform to this convention.
* Add the ability to reinitialize a mutex (internally, not a userlanddeischen2003-11-041-7/+20
| | | | | | API). Reviewed by: davidxu
OpenPOWER on IntegriCloud