| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Use bare mmap(2) to allocate space for the per-thread keys,
instead of malloc(). This allows third party mallocs, which use
pthread_setspecific(3) on the allocation path, to work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r282057:
Build/install libc, librt, libthr, and msun NetBSD test suites on all
architectures
r282092 (by andrew):
Correct the spelling of MACHINE_CPUARCH, MACHINE_CPU is not set on arm64.
r282106:
Remove per-architecture checks for enabling HAVE_FENV_H
The conditional came from NetBSD, where only select architectures have this
header/support
All architectures on FreeBSD have the necessary support though, so the
conditional's completely unnecessary
make tinderbox done on all architectures (including arm64, where the issue
occurred before) this time
|
|
|
|
|
|
|
|
| |
_pthread_cleanup_push: fix allocator sizeof operand mismatch
Same fix appears to be in DragonFly's libthread_xu.
Found by: Clang Static Analyzer
|
|
|
|
| |
Make wait6(2), waitid(3) and ppoll(2) cancellation points.
|
|
|
|
| |
Make kevent(2) a cancellation point.
|
|
|
|
| |
Propagate errors from _thr_umutex_unlock2 through mutex_unlock_common.
|
|
|
|
| |
Update libthr(3) man page to reflect the work done to support dlopen.
|
|
|
|
| |
Properly interpose libc spinlocks, was missed in r276630.
|
|
|
|
| |
Fully initialize allocated memory for the new barrier.
|
|
|
|
| |
Do not allow pthread_sigmask() to block SIGCANCEL.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(or loading a dso linked to libthr.so into process which was not
linked against threading library).
MFC r276630:
Remove interposing, fix malloc, reinstall signal handlers wrappers on
libthr load.
MFC r276681:
Avoid calling internal libc function through PLT or accessing data
though GOT.
MFC r277032:
Reduce the size of the interposing table and amount of
cancellation-handling code in the libthr.
MFC note:
r276646 ("do not erronously export 'openat' symbol from rtld") is not
applicable to stable/10 yet, since PATHFDS support was not merged.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r274578:
Add reachover Makefiles for contrib/netbsd-tests/lib/libpthread as
lib/libthr/tests
A variant of this code has been tested on amd64/i386 for some time by
EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the
code will remain off until it's proven it works on virtual hardware or real
hardware on other architectures
Original work by: pho
Sponsored by: EMC / Isilon Storage Division
r274580:
Add reachover Makefiles for contrib/netbsd-tests/lib/librt
A variant of this code has been tested on amd64/i386 for some time by
EMC/Isilon on 10-STABLE/11-CURRENT. It builds on other architectures, but the
code will remain off until it's proven it works on virtual hardware or real
hardware on other architectures
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
|
| |
Expand the libthr(3) manpage to document knobs accepted by libthr.so
and explain some internal working of the library, neccessary to
understand the knobs effects.
MFC r272153 (by pluknet):
Fix description of mutex acquisition.
|
|
|
|
|
|
| |
Switch the defaults to not split the RLIMIT_STACK-sized initial thread
stack into the stacks of the created threads. Add knob
LIBPTHREAD_SPLITSTACK_MAIN to restore the older behaviour.
|
|
|
|
|
|
| |
Add a knob LIBPTHREAD_BIGSTACK_MAIN, which instructs libthr to leave
the whole RLIMIT_STACK-sized region of the kernel-allocated stack as
the stack of main thread.
|
|
|
|
| |
Style.
|
|
|
|
| |
Change the _rtld_atfork() to lock the bind lock in write mode.
|
|
|
|
|
|
|
| |
In _pthread_kill(), if passed pthread is current thread, do not send
the signal second time, by adding the missed else before if statement.
PR: threads/186309
|
|
|
|
|
|
|
| |
Fix for the spurious signal handler call with zero signo in the threaded
process.
Approved by: re (hrs)
|
|
|
|
|
|
|
|
|
| |
cancellation point. When enabling the cancellation, only process the
pending cancellation for asynchronous mode.
Reported and reviewed by: Kohji Okuno <okuno.kohji@jp.panasonic.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
|
|
|
|
|
|
|
|
|
| |
identified, unify the code of check_deferred_signal() for all
architectures, making the variant under #ifdef x86 common.
Tested by: marius (sparc64)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
check_deferred_signal() returns twice, since handle_signal() emulates
the return from the normal signal handler by sigreturn(2)ing the
passed context. Second return is performed on the destroyed stack
frame, because __fillcontextx() has already returned. This causes
undefined and bad behaviour, usually the victim thread gets SIGSEGV.
Avoid nested frame and the need to return from it by doing direct call
to getcontext() in the check_deferred_signal() and using a new private
libc helper __fillcontextx2() to complement the context with the
extended CPU state if the deferred signal is still present.
The __fillcontextx() is now unused, but is kept to allow older
libthr.so to be used with the new libc.
Mark __fillcontextx() as returning twice [1].
Reported by: pgj
Pointy hat to: kib
Discussed with: dim
Tested by: pgj, dim
Suggested by: jilles [1]
MFC after: 1 week
|
|
|
|
|
|
|
| |
and fix typo.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
|
|
|
|
|
|
| |
in the first place.
Initial patch submitted by: phk
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The accept4() function, compared to accept(), allows setting the new file
descriptor atomically close-on-exec and explicitly controlling the
non-blocking status on the new socket. (Note that the latter point means
that accept() is not equivalent to any form of accept4().)
The linuxulator's accept4 implementation leaves a race window where the new
file descriptor is not close-on-exec because it calls sys_accept(). This
implementation leaves no such race window (by using falloc() flags). The
linuxulator could be fixed and simplified by using the new code.
Like accept(), accept4() is async-signal-safe, a cancellation point and
permitted in capability mode.
|
|
|
|
| |
already done this.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
by using buggy getcontext/setcontext on same stack, while swapcontext
normally works on different stack, there is no such a problem.
|
| |
|
|
|
|
|
|
| |
the context becomes invalid when the function returns, same as setjmp,
it must be implemented in assemble language, see discussions in PR
misc/177624.
|
|
|
|
|
|
|
|
|
|
|
| |
The threaded rtld lock implementation is faster even in the single-threaded
case because it postpones signal handlers via THR_CRITICAL_ENTER and
THR_CRITICAL_LEAVE instead of calling sigprocmask(2).
As a result, exception handling becomes faster in single-threaded
applications linked with libthr.
Reviewed by: kib
|
|
|
|
|
|
|
| |
pthread_suspend_all_np() may have already suspended its parent thread.
Add locking code in pthread_suspend_all_np() to only allow one thread
to suspend other threads, this eliminates a deadlock where two or more
threads try to suspend each others.
|
|
|
|
| |
in init_private(), don't call it again in fork() wrapper.
|
|
|
|
|
|
|
|
| |
for process, thread or others we want to support.
Use the syscall to implement POSIX API clock_getcpuclock and
pthread_getcpuclockid.
PR: 168417
|
|
|
|
| |
Handle TLS for ARMv6 and ARMv7
|
| |
|
|
|
|
|
| |
Further decreases unexpected context switches by defering mutex wakeup
until internal sleep queue lock is released.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
replace _thr_ref_add() with _thr_find_thread(),
so reference count is no longer needed.
MFC after: 3 days
|
|
|
|
|
|
|
| |
be acquired.
PR: 168317
MFC after: 3 days
|
|
|
|
| |
redundant SC_LOOKUP() calling.
|
|
|
|
| |
upper level.
|