Age | Commit message (Collapse) | Author |
|
``Correct the _atomic_lock() asm so that gcc accepts the constraints
when compiling without optimization; fix copied from the kernel's atomic.h''
spotted by jim@
|
|
attribute then make pthread_create() return EINVAL instead of whatever
was in errno on entry (possibly making it appear it succeeded when it
really failed). Encountered by Jung (moorang at gmail.com).
|
|
|
|
Avoid missed wakeups in pthread_rwlock_{rd,wr}lock() by linking the spinlocks.
ok tedu@
|
|
files or directories when applicable.
The inspiration and name of MACHINE_CPU come from NetBSD, although the way to
provide it to Makefiles is completely different.
ok kettenis@
|
|
syscall ABI has changed and everything is going to need to be relinked
anyway, bump the rthread major
|
|
race condition and prep for later support of pthread_condattr_setclock()
"get it in" deraadt@, tedu@, cheers by others
|
|
and struct timespec * argument. sigtimedwait is just a one line
wrapper after this.
"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
|
|
once and not on every wakeup.
ok kurt@
|
|
aliased ENOTSUP. i should've done this earlier, but missed it. my bad.
as discussed with deraadt@ guenther@
|
|
ok kurt@
|
|
is needed to avoid deadlocks in popen() on FILE locking.
ok kurt@
|
|
pointed out by brad, ok djm@
|
|
ok kettenis@, art@
|
|
|
|
when compiling without optimization; fix copied from the kernel's atomic.h
ok miod@
|
|
64bit archs to accommodate the growing number of ports that put large
buffers on the stack. Supported by many with no objections.
|
|
finally reading the lint warnings (sigh)
ok tedu@
|
|
|
|
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
|
|
full set of warnings from the compiler
|
|
|
|
"look good" tedu@
|
|
signal is already pending in the calling thread or the main thread
and there's no longer a race condition where the signal could be
diverted but sigwait() would still block. There were some off-by-one
errors too.
(The checking of the main thread's pending list is just until a
pending list for the process can be added to struct process. For
now, such signals end up as pending on the main thread.)
oks tedu@ and art@
|
|
|
|
|
|
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
|
|
Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.
OK deraadt@
|
|
|
|
- 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@
|
|
|
|
sigprocmask(2) in threaded programs.
From Philip Guenther <guenther at sendmail.com> via PR library/5795.
okay marc@
|
|
|
|
_thread_atexit_unlock(). okay tedu@
|
|
instead of the generic pthread macros since free(3) uses __arc4_getbyte()
when freeing small sized allocations and the generic pthread macros call
malloc(3).
- eliminate passing pointers to a static variable with global scope (rs)
for additional code clarity and reduction.
- shlib minor bumps for libc and libpthread due to new functions.
From andreas@ with some bits from me. okay tedu@ marc@ w/some spot
checking from millert@
|
|
pthread_stackseg_np(). With input and okay marc@
|
|
isolate its usage to libpthread only and replace with generic non-static
mutex support in the one place it is needed:
- remove _FD_LOCK/UNLOCK from lseek and ftruncate in libc and make the
functions weak so that libpthread can override with its own new
versions that do the locking.
- remove _thread_fd_lock/unlock() weak functions from libc and adjust
libpthread for the change.
- add generic _thread_mutex_lock/unlock/destroy() weak functions in libc
to support non-static mutexes in libc and add libpthread and librthread
implementations for them. libc can utilize non-static mutexes via the
new _MUTEX_LOCK/UNLOCK/DESTROY() macros. Actually these new macros can
support both static and non-static mutexes but currently only using
them for non-static.
- make opendir/closedir/readdir/readdir_r/seekdir/telldir() thread-safe
for both thread libraries by using a non-static mutex in the struct
_dirdesc (typedef DIR), utilizing it in the *dir functions and remove
remaining and incorrect _FD_LOCK/UNLOCK() use in libc.
- add comments to both thread libraries to indicate libc depends on the
current implementation of static mutex initialization. suggested by
marc@
- major bump libc and libpthread due to function removal, structure
change and weak symbol conversions.
okay marc@, tedu@
|
|
|
|
drahn@ ok (long time ago)
|
|
|
|
|
|
|
|
|
|
pthreads header changed, char * -> const char *
|
|
|
|
can be set in the environment using RTHREAD_DEBUG.
ok, tedu@
|
|
didn't like it.
|