| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
UMTX_OP_WAIT. Upper 16bits is enough to hold a clock id, and lower
16bits is used to pass flags. The change saves a clock_gettime() syscall
from libthr.
|
|
|
|
| |
is zero may trigger timeout too early. It seems a copy&paste bug.
|
| |
|
|
|
|
|
|
|
| |
queue pointers, just reuse it.
PR: 164828
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the signal handlers with the context information in the deferrred
case.
Only enable the use of getcontextx(3) in the deferred signal delivery
code on amd64 and i386. Sparc64 seems to have some undetermined issues
with interaction of alloca(3) and signal delivery.
Tested by: flo (who also provided sparc64 harware access for me), pho
Discussed with: marius
MFC after: 1 month
|
|
|
|
|
|
|
|
|
| |
timeout correctly for pthread_cond_timedwait when
it uses kernel-based condition variable.
PR: 162403
Submitted by: jilles
MFC after: 3 days
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
used a global pthread_mutex_t for synchronization. r179417 replaced that
with an implementation that directly used atomic instructions and thr_*
syscalls to synchronize callers to pthread_once. However, calling
pthread_mutex_lock on the global mutex implicitly ensured that
_thr_check_init() had been called but with r179417 this was no longer
guaranteed. This meant that if you were unlucky enough to have your first
call into libthr be a call to pthread_once(), you would segfault when
trying to access the pointer returned by _get_curthread().
The fix is to explicitly call _thr_check_init() from pthread_once().
Reviewed by: davidxu
Approved by: emaste (mentor)
MFC after: 1 week
|
|
|
|
|
|
|
| |
calling thread's unique integral ID, which is similar to AIX function of
the same name. Bump __FreeBSD_version to note its introduction.
Reviewed by: kib
|
|
|
|
| |
Submitted by: avg
|
|
|
|
|
|
|
| |
threading, fall back to libc method of performing
__pthread_map_stacks_exec() job.
Reported and tested by: Mykola Dzham <i levsha me>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Stack creation code is changed to call _rtld_get_stack_prot() to get
the stack protection right. There is a race where thread is created
during dlopen() of dso that requires executable stacks. Then,
_rtld_get_stack_prot() may return PROT_READ | PROT_WRITE, but thread
is still not linked into the thread list. In this case, the callback
misses the thread stack, and rechecks the required protection
afterward.
Reviewed by: davidxu
|
|
|
|
| |
Found by: clang static analyzer
|
|
|
|
| |
queue locked.
|
|
|
|
| |
significant for lock owner.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add flags CVWAIT_ABSTIME and CVWAIT_CLOCKID for umtx kernel based
condition variable, this should eliminate an extra system call to get
current time.
- Add sub-function UMTX_OP_NWAKE_PRIVATE to wake up N channels in single
system call. Create userland sleep queue for condition variable, in most
cases, thread will wait in the queue, the pthread_cond_signal will defer
thread wakeup until the mutex is unlocked, it tries to avoid an extra
system call and a extra context switch in time window of pthread_cond_signal
and pthread_mutex_unlock.
The changes are part of process-shared mutex project.
|
| |
|
|
|
|
| |
Submitted by: avg
|
|
|
|
|
| |
because the variable can be in register, second checking the variable
may still return true, however this is unexpected.
|
|
|
|
| |
size kernel is using.
|
|
|
|
| |
- Use long word to figure out sizeof kernel cpuset, hope it works.
|
|
|
|
|
| |
it can not fix race condition in application code, as a result,
the problem described in PR threads/151767 is avoided.
|
| |
|
|
|
|
| |
MFC after: 7 days
|
|
|
|
|
|
|
| |
a silly rwlock deadlock problem, the deadlock is caused by writer
waiters, if a thread has already locked a reader lock, and wants to
acquire another reader lock, it will be blocked by writer waiters,
but we had already fixed it years ago.
|
|
|
|
| |
is the type we are using.
|
| |
|
|
|
|
|
|
|
|
|
| |
functions set or get pthread_rwlock type, current supported types are:
PTHREAD_RWLOCK_PREFER_READER_NP,
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
PTHREAD_RWLOCK_PREFER_WRITER_NP,
default is PTHREAD_RWLOCK_PREFER_WRITER_NONCECURSIVE_NP, this maintains
binary compatible with old code.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
same null value, the code can not distinguish between them, to
fix the problem, now a destroyed object is assigned to a non-null
value, and it will be rejected by some pthread functions.
PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP is changed to number 1, so that
adaptive mutex can be statically initialized correctly.
|
|
|
|
| |
debugger may can not find it on thread list.
|
| |
|
| |
|
|
|
|
|
|
| |
it is incompatible with stack unwinding code, if they are invoked,
disable stack unwinding for current thread, and when thread is
exiting, print a warning message.
|
|
|
|
| |
direction.
|
|
|
|
|
|
|
| |
for them, two functions _pthread_cancel_enter and _pthread_cancel_leave
are added to let thread enter and leave a cancellation point, it also
makes it possible that other functions can be cancellation points in
libraries without having to be rewritten in libthr.
|
|
|
|
| |
almost false, this makes a slight better branch predicting.
|
|
|
|
| |
because cancellation is almostly checked at cancellation points.
|
|
|
|
|
|
| |
whether asynchronous mode is turned on or not, this always gives us a
chance to decide whether thread should be canceled or not in
cancellation points.
|
|
|
|
| |
by atfork handler is unsafe, use intenal flag no_cancel to disable it.
|
| |
|
|
|
|
|
|
| |
- Use a store barrier to make sure uwl_forcedunwind is lastest thing
other threads can see.
- Add some comments.
|
| |
|
|
|
|
|
|
| |
defer-mode cancellation works, asynchrnous mode does not work because
it lacks of libuwind's support. stack unwinding is not enabled unless
LIBTHR_UNWIND_STACK is defined in Makefile.
|
|
|
|
| |
still share same lock.
|
| |
|
| |
|
|
|
|
| |
checked it.
|