| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
PR: 75273
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
signals instead of having more intricate knowledge of thread state
within signal handling.
Simplify signal code because of above (by David Xu).
Use macros for libpthread usage of pthread_cleanup_push() and
pthread_cleanup_pop(). This removes some instances of malloc()
and free() from the semaphore and pthread_once() implementations.
When single threaded and forking(), make sure that the current
thread's signal mask is inherited by the forked thread.
Use private mutexes for libc and libpthread. Signals are
deferred while threads hold private mutexes. This fix also
breaks www/linuxpluginwrapper; a patch that fixes it is at
http://people.freebsd.org/~deischen/kse/linuxpluginwrapper.diff
Fix race condition in condition variables where handling a
signal (pthread_kill() or kill()) may not see a wakeup
(pthread_cond_signal() or pthread_cond_broadcast()).
In collaboration with: davidxu
|
|
|
|
|
| |
kernels. Use the recently exposed direct-set routines instead. This is
only activated for when we compile i386 support libraries on amd64.
|
| |
|
| |
|
|
|
|
|
|
|
| |
a thread in pthread_cond_wait handled a signal can no longer
be canceled.
Reviewed by: deischen
|
|
|
|
|
|
|
|
|
| |
packages expect and seems to be most correct according to the slightly-
ambiguous standards.
MFC after: 1 month
Corroborated by: POSIX <http://tinyurl.com/4uvub>
Reviewed by: silence on threads@
|
|
|
|
| |
any fake value.
|
|
|
|
|
| |
this reduces chances of signal losting problem found by
Peter Holm <peter@holm.cc>
|
|
|
|
|
|
|
|
|
|
|
| |
put DEAD thread on GC list, this closes a race between pthread_join
and thr_cleanup.
2. Introduce a mutex to protect tcb initialization, tls allocation and
deallocation code in rtld seems no lock protection or it is broken,
under stress testing, memory is corrupted.
Reviewed by: deischen
patch partly provided by: deischen
|
|
|
|
| |
leak under some cases.
|
|
|
|
|
|
| |
before and after sleeping.
Reviewed by: deischen
|
| |
|
|
|
|
| |
of kse_thr_interrupt.
|
|
|
|
|
| |
allocated space, orignal code left red zone unallocated, but those space
can be allocated by user code, and result was providing no protection.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the signal mask and pending signals of the calling thread. These
are stored in userland in libpthread.
There is a small race condition in this patch which could cause
problems if a signal arrives after setting the (kernel) signal
mask and before exec'ing. The thread's set of pending signals
also are not yet installed in the exec'd process. Both of these
will be corrected with the addition of a special syscall.
Reported & Tested by: Joost Bekkers <joost at jodocus dot org>
Reviewed by: julian, davidxu
|
| |
|
|
|
|
|
|
| |
defined. This makes libpthread usable on powerpc.
Approved by: grehan (mentor), deischen
|
| |
|
|
|
|
| |
Reviewed by: deischen
|
|
|
|
| |
Reviewed by: desichen
|
| |
|
| |
|
|
|
|
| |
2. Export symbols needed by debugger.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Reviewed by: deischen
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Dicussed with: deischen
|
|
|
|
| |
kse_switchin syscall.
|
| |
|
|
|
|
| |
athlon64 machine.
|
|
|
|
| |
the time being.
|
|
|
|
| |
libthread_db. Both headers are included seperately.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
_amd64_restore_context().
|
|
|
|
| |
as stubs.
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
in return value not in errno.
|
| |
|
|
|
|
|
|
|
|
| |
These files had tags after the copyright notice,
inside the comment block (incorrect, removed),
and outside the comment block (correct).
Approved by: rwatson (mentor)
|
|
|
|
|
|
|
|
| |
semaphores. Also add cancellation cleanup handlers to keep semaphores
in a consistent state.
Submitted in part by: davidxu
Reviewed by: davidxu
|