| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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)
|
| |
|
|
|
|
|
|
|
|
| |
errors similar to PTHREAD_MUTEX_ERRORCHECK, however upon error it aborts.
The rational is that many applications don't check the return values on
pthread functions and will miss the errors that ERRORCHECK returns.
PTHREAD_MUTEX_STRICT_NP will be our default mutex type for awhile
okay guenther@ dcoppa@
|
|
|
|
|
|
| |
default mutex type changes to NORMAL, when there is an uninitialized
mutex provided to unlock, allow it to succeed similar to an unlocked
mutex. For other cases abort instead of segfault. okay guenther@
|
|
|
|
|
|
| |
certain conditions. In the case of unlocking an unlocked mutex we will
allow that to succeed, all other undefined behaviors will result in an
immediate abort(). okay guenther@
|
|
|
|
|
|
|
|
|
|
| |
to unlock an uninitialized mutex is required to return EPERM, so add
the necessary checks.
For recursive mutexes, return an error from pthread_mutex_lock()
if the count would overflow.
problem observed in glib testing by aja@
|
|
|
|
|
| |
That deadlock can be exited via a timeout for pthread_mutex_timedlock().
Unwind all the state when pthread_mutex_timedlock() times out
|
|
|
|
| |
Add pthread_mutex_timedlock(), requested by dcoppa@
|
|
|
|
| |
moved. Unlocking a spinlock twice is bad, mmkay?
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
ok guenther@
|
|
|
|
| |
to new files rthread_rwlock.c, rthread_rwlockattr.c, and rthread_once.c
|
|
|
|
|
|
|
| |
new file rthread_mutexattr.c. Add basic implementations of
pthread_mutexattr_{set,get}{protocol,prioceiling}
Requested by aja
|
| |
|
|
|
|
|
| |
called on an ERRORCHECK mutex that is locked by this thread. Problem
observed by uwe@
|
|
|
|
|
|
| |
Avoid missed wakeups in pthread_rwlock_{rd,wr}lock() by linking the spinlocks.
ok tedu@
|
|
|
|
|
|
| |
race condition and prep for later support of pthread_condattr_setclock()
"get it in" deraadt@, tedu@, cheers by others
|
|
|
|
|
|
| |
once and not on every wakeup.
ok kurt@
|
|
|
|
| |
"look good" tedu@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
|
|
|
|
|
| |
Minor tweaks to compile with the above, primarily in fixing
the conflicts between semaphore.h and rthread.h
"i like the additional warnings" tedu@
|
|
|
|
| |
ok otto@
|
|
|
|
| |
update for new thrwakeup that takes a count argument
|
| |
|
|
|
|
| |
interfaces that aren't static, and a few that are but which will change
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
1. the time was off by a factor of 10
2. wouldn't return error code if timeout was reached
3. the big one. thrsleep syscall doesn't return EWOULDBLOCK. it
returns -1 and puts the error in errno. doh.
|
| |
|
|
|
|
| |
value if there are no waiters.
|
|
|
|
| |
ok brad
|
|
|
|
| |
defines the pthread_once_t internals, so we're stuck with them.
|
|
|