| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
For all libthr contexts, use ${MACHINE_CPUARCH}
for all libc contexts, use ${MACHINE_ARCH} if it exists, otherwise use
${MACHINE_CPUARCH}
Move some common code up a layer (the .PATH statement was the same in
all the arch submakefiles).
# Hope she hasn't busted powerpc64 with this...
|