Age | Commit message (Collapse) | Author |
|
and spinning in kernel. partially back out, but in a way that makes going
forward again easy.
seen by ajacoutot
|
|
it's now atomic_lock to better reflect its usage, and librthread now
features a new spinlock that's really a ticket lock.
thrlseep can handle both types of lock via a flag in the clock arg.
(temp back compat hack)
remove some old stuff that's accumulated along the way and no longer used.
some feedback from dlg, who is concerned with all things ticket lock.
(you need to boot a new kernel before installing librthread)
|
|
|
|
and vax doesn't support symbols that are both weak and undefined (yet?).
sparc issue diagnosed by kettenis@, vax problem found by todd@
|
|
if the initial thread already has a TCB then don't override it, and
if the _dl_allocate_tls() and _dl_free_tls() symbols exist then use
them instead of malloc/free
ok kettenis@
|
|
we should actually check for _DYNAMIC at run-time rather than checking
for __PIC__ at compile time, since the two are actually independent.
Problem and solution identified by guenther; minor tweaks by me.
ok guenther
|
|
from bsd.lib.mk for C source files.
ok deraadt, pascal
|
|
accordingly so vax can build again.
ok deraadt
|
|
overrides provided by libpthread.a. This ensures that statically
linked threaded programs use (e.g.) __cerror() from libpthread.a
instead of libc.a. (Same idea previously used by libuthread.)
Thanks to fgsch@ for pointing out libuthread's solution to the static
linking problem.
ok guenther@, tedu@;
|
|
so that it can't get a signal while still running on the parent thread's
stack. Also, pass in sizeof(struct __tfork) to provide forward compat
when more members are added. This is an ABI change, so switch syscall
numbers and bump lib majors this time.
ok deraadt@ matthew@
|
|
ok kurt@
|
|
rthreads major library bump from last night. okay kettenis@
|
|
may need to call dlclose().
problem observed by Antti Harri (iku at openbsd.fi), ok kurt@
|
|
a function that can call sched_yield(), to avoid recursion
ok kurt@ kettenis@
|
|
that it resumes waiting unless the thread was canceled. As part
of this, change the internal _sem_wait() function to return zero
on success and an errno value on failure instead of 1 on success
and zero on failure.
|
|
|
|
non-standard alias, so prefer the former
|
|
lint doesn't understand designated initializers, so hide them from it
|
|
Improve consistency of error naming
|
|
don't try to merge values, round the sizes separately, and don't try to
unmap application-supplied stacks.
Copy from uthread the caching of default-sized stacks.
Have pthread_attr_init() and pthread_create() get the default attributes
from staticly allocated pthread_attr_t.
Cache the pagesize in _rthread_init() and provide a macro for rounding to it
based on suggestions from kettenis@ and tedu@, ok kettenis@
|
|
properly represents whether a process is multi-threaded or not. This fixes
a bug where if a forked child would create a new thread we would not set
__isthreaded.
ok guenther@
|
|
particularly the "consume the signal you just sent" hang, and putting
the wait queues in userspace.
Do cancellation handling in pthread_cond_*wait(), pthread_join(),
and sem_wait().
Add __ prefix to thr{sleep,wakeup,exit,sigdivert}() syscalls; add
'abort" argument to thrsleep to close cancellation race; make
thr{sleep,wakeup} return errno values via *retval to avoid touching
userspace errno.
|
|
so prefer it for identifying the current thread
|
|
|
|
|
|
using previously allocated SIGTHR to interrupt in-process syscalls
and fixing the spelling of "cancelled" along the way.
Modeled on FreeBSD's libthr
|
|
thread list
reminded by dhill@
|
|
|
|
errno. The ASM bits for _cerror are sketchy or missing for some archs
but that can be corrected in-tree.
|
|
race condition and prep for later support of pthread_condattr_setclock()
"get it in" deraadt@, tedu@, cheers by others
|
|
kernel so that librthread can detect when a thread is completely
done with its stack without need a kqueue. The dying thread moves
itself to a GC list, other threads scan the GC list on pthread_create()
and pthread_join() and free the stack and handle once the thread's
thread id is zeroed.
"get it in" deraadt@, tedu@, cheers by others
|
|
by pid,
so in the event that two threads get the same pid in a row, as the second is dying it
will update (not add) the kevent for the previous thread with its own stack, which it
will then unmap soon after, which is bad. Doing the reaping first guarantees that there
are no kevents with the same pid as the exiting thread when it registers itself.
ok guenther kurt
|
|
"look good" tedu@
|
|
instead of crashing
ok kurt@
first observed by Jung <moorang at gmail.com>
|
|
unblocks the pthread_join() for this thread until the exiting thread is
completely done with its thread structure, as the joining thread will
free it once unblocked. Also, don't bother to call _sem_post() if the
thread is detached.
ok kurt@
|
|
structure, as the 'tid' member there is used by other parts of
librthread to determine whether the current thread is the initial thread
|
|
- Make an effort to protect important libc and ld.so critical areas during
the fork(2)/vfork(2) sys call.
- Add pthread_atfork(3) implementation based on Daniel Eischen's code.
Original diff by Philip Guenther <guenther at gmail.com> with some
additions and refinements by me. Positive test report from brad@ with
many kde apps. fork(2) and pthread_atfork(3) pthread regresses pass.
okay tedu@, kettenis@, marc@
|
|
drahn@ ok (long time ago)
|
|
can be set in the environment using RTHREAD_DEBUG.
ok, tedu@
|
|
didn't like it.
|
|
with ourself and only free thread after a succesful join. ok marc@
|
|
|
|
Minor tweaks to compile with the above, primarily in fixing
the conflicts between semaphore.h and rthread.h
"i like the additional warnings" tedu@
|
|
not use a separate reaper thread. ok tedu@ marc@
|
|
do not allow a join to a detached thread
"it looks good" otto@
|
|
size (and guard zone size) to be set using pthread_attr. Guard
zones are specified in bytes, but implemented in terms of a
page size.
OK Otto@
|
|
With this, java seems to be operational. Also make threads_ready
non-static, which is needed for an upcoming diff. ok tedu@
|
|
|
|
and fix a bug in thread creation error path. ok tedu@
|
|
will make the right thing happen. verified by kettenis and drahn
|