| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
* locks/unix/thread_mutex.c,
include/arch/unix/apr_arch_thread_mutex.h: Completely drop the code
required imitate the mutex via a condition variable if
HAVE_PTHREAD_MUTEX_TIMEDLOCK is defined.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1891269 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
locks: thread: timedlock: better handling of spurious wakeups that may be
inherent to some native/OS condvar implementation.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1855959 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
After first Mac then Solaris biting us, timedlocks look high-risk,
so a config option and a corresponding rlease note offer a workaround
to any users who get bitten.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1791932 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
apr_{thread,proc,global}_timedlock() with negative timeout is now equivalent
to apr_{thread,proc,global}_trylock(), i.e. immediate attempt to acquire the
lock (but returning APR_TIMEUP if busy).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1790633 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
locks: follow up to r1790488.
Make it clear in the type that it's a relative/interval time.
locks: follow up to r1790488 and r1790521: likewise for the
apr_proc_mutex_unix_lock_methods_t's timedacquired method.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1790527 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
locks: follow up to r1667900.
Axe the 'absolute' argument of apr_{thread,proc,global}_mutex_timedlock()
which was confusing, hence 'timeout' is always relative now.
It still makes sense (to me) to handle a negative timeout as INFINITE, a nul
one as IMMEDIATE, and a positive one as an upper bound timeout (like most if
not all of the underlying system calls...).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1790490 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r1790439, r1790444, r1790446 from trunk:
Follow up to r1667900: semtimedop() should be passed a relative timeout rather
then absolute.
semtimedop() takes a delta time, so accept what is given as the "time remaining"
rr1790301
Use our "portable" versions
Make clear this is a delta timeout
locks: when pthread_mutex_timedlock() isn't available, fall back to an
implementation based on pthread_cond_timedwait() when possible.
Avoid a compiler warning by using system's errno.
locks: follow up to r1790330.
When no native timedlock is available, fall back to a common/generic spin sleep
proc_mutex_spinsleep_timedacquire() based on the configured APR_USE_*_SERIALIZE
trylock.
Otherwise, choose the best timedlock mechanism in the following order:
1. PTHREAD if HAVE_PTHREAD_MUTEX_ROBUST && (HAVE_PTHREAD_MUTEX_TIMEDLOCK
|| HAVE_PTHREAD_CONDATTR_SETPSHARED)
2. SYSV if HAVE_SEMTIMEDOP
3. POSIX if HAVE_SEM_TIMEDWAIT
4. The one of APR_USE_*_SERIALIZE, hence possibly non-robust and/or spinning
with the same robustness as the underlying apr_proc_mutex_trylock() call.
apr_proc_mutex_timedlock() won't return ENOTIMPL anymore.
locks: follow up to r1790330 and r1790436.
unix/misc.c is not needed anymore since we use apr_proc_mutex_trylock()
directly.
locks: follow up to r1790330.
No functional change, more helpers/macros to help identify struct
proc_pthread_mutex_t members.
locks: follow up to r1790330.
Don't try to access proc_pthread_mutex_t's condvar if the mutex was _put[_ex]()
and not _create()d, this is a real pthread_mutex_t.
Submitted by: ylavic, jim, jim, jim, ylavic, ylavic, ylavic, ylavic, ylavic, ylavic
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1790474 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
osx/macos that don't have it. Be a bit more generous in the test
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1790105 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r1732582 from trunk:
OS/2: Add an implementation of condition variables, derived from the Win32
implementation.
locks: introduce apr_{thread,proc,global}_mutex_timedlock().
For proc mutexes, the new mechanism APR_LOCK_DEFAULT_TIMED usable at creation time
allows for the best mechanism to be elected (unixes: 1 to 3, or specific: 4 to 7):
1. PROC_PTHREAD if pthread_mutex_timedlock() and pthread_mutex_set_robust_np()
are both available,
2. SYSV if semtimedop() is availale,
3. POSIXSEM if sem_timedwait() is available,
4. BeOS' acquire_sem_etc() if available,
5. NetWare falls back to apr_thread_mutex_timedlock() as for others functions,
6. OS2's DosRequestMutexSem(),
7. Windows' WaitForSingleObject().
Otherwise (like when fcntl and flock only are availble, if that's ever possible),
APR_ENOTIMPL is returned.
For thread mutexes, the new flag APR_THREAD_MUTEX_TIMED, usable at create()
time still, allows to switch to an implementation using a condition variable
and apr_thread_cond_timedwait() when if no native mechanism is available (eg.
NetWare, pthreads but without pthread_mutex_timedlock() available).
On windows, this initializes a WaitForSingleObject()able handle (Mutex) instead
of the fastest (but not timeout-able) CRITICAL_SECTION used by default.
All apr_{thread,proc,global}_mutex_timedlock() functions can take a relative or
absolute time, thanks to the last (boolean) argument.
Test suite updated accordingly.
Follow up to r1667900: revert spurious change on test/abts_tests.h.
Follow up to r1667900: fix comments.
Follow up to r1667900: handle negative (infinite) timeout in mutex/cond timedlock/timedwait.
locks: follow up to r1667900.
In apr_global_mutex_timedlock(), we can avoid converting from relative to
absolute time if thread locking is not needed.
make internal function static to avoid a warning
Follow up to r1667900: Avoid a circular reference (PR 59068).
Submitted by: bjh, ylavic, ylavic, ylavic, ylavic, ylavic, trawick, ylavic
Reviewed/backported by: ylavic
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1733684 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
simplification, it fixes a compile error in the call to
pthread_yield() on z/OS.
Submitted by: David Jones
I modified it slightly to use AC_DEFINE() as suggested
by jorton.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@596402 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428317 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@428313 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
recursive mutex support if available:
* build/apr_threads.m4 (APR_CHECK_PTHREAD_RECURSIVE_MUTEX): New macro.
* configure.in: Use it.
* include/arch/unix/apr_arch_thread_mutex.h (struct
apr_thread_mutex_t): Drop nested mutex tracking fields.
* locks/unix/thread_mutex.c (apr_thread_mutex_create): Return ENOTIMPL
if lacking recursive mutex support, else create a recursive mutex.
(apr_thread_mutex_lock, apr_thread_mutex_unlock,
apr_thread_mutex_trylock): Remove nested mutex tracking.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65157 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64749 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64747 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
Fixes build breakage.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64581 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as reentrant as possible. Switched to atomics to preserve the
incr/decr integrity.
Although we previously reset the thread_id to zero, it's been
pointed out on list that this is less than desireable. However,
negative one isn't necessarily a good choice because several
platforms have unsigned thread_t's.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64579 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
pthread_mutex_destroy(NULL) if pthread_mutex_init() fails.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64534 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
don't check for allocation failure.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64533 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
pthread_mutex_init() is equivalent to passing NULL: simplify
apr_thread_mutex_create() to do the latter.
Fixes build on BSD/OS 4.0, which prototypes but does not implement
pthread_mutexattr_{init,destroy}, fooling the autoconf checks.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64532 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
aix/dso.h -> -> aix/apr_arch_dso.h
beos/dso.h -> beos/apr_arch_dso.h
beos/proc_mutex.h -> beos/apr_arch_proc_mutex.h
beos/thread_cond.h -> beos/apr_arch_thread_cond.h
beos/thread_mutex.h -> beos/apr_arch_thread_mutex.h
beos/threadproc.h -> beos/apr_arch_threadproc.h
beos/thread_rwlock.h -> beos/apr_arch_thread_rwlock.h
netware/dso.h -> -> netware/apr_arch_dso.h
netware/fileio.h -> -> netware/apr_arch_fileio.h
netware/global_mutex.h -> netware/apr_arch_global_mutex.h
netware/internal_time.h -> netware/apr_arch_internal_time.h
netware/networkio.h -> netware/apr_arch_networkio.h
netware/pre_nw.h -> netware/apr_arch_pre_nw.h
netware/proc_mutex.h -> netware/apr_arch_proc_mutex.h
netware/thread_cond.h -> netware/apr_arch_thread_cond.h
netware/thread_mutex.h -> netware/apr_arch_thread_mutex.h
netware/threadproc.h -> netware/apr_arch_threadproc.h
netware/thread_rwlock.h -> netware/apr_arch_thread_rwlock.h
os2/dso.h -> os2/apr_arch_dso.h
os2/fileio.h -> os2/apr_arch_fileio.h
os2/networkio.h -> os2/apr_arch_networkio.h
os2/os2calls.h -> os2/apr_arch_os2calls.h
os2/proc_mutex.h -> os2/apr_arch_proc_mutex.h
os2/thread_cond.h -> os2/apr_arch_thread_cond.h
os2/thread_mutex.h -> os2/apr_arch_thread_mutex.h
os2/threadproc.h -> os2/apr_arch_threadproc.h
os2/thread_rwlock.h -> os2/apr_arch_thread_rwlock.h
os390/dso.h -> os390/apr_arch_dso.h
unix/dso.h -> unix/apr_arch_dso.h
unix/fileio.h -> unix/apr_arch_fileio.h
unix/global_mutex.h -> unix/apr_arch_global_mutex.h
unix/inherit.h -> unix/apr_arch_inherit.h
unix/internal_time.h -> unix/apr_arch_internal_time.h
unix/misc.h -> unix/apr_arch_misc.h
unix/networkio.h -> unix/apr_arch_networkio.h
unix/proc_mutex.h -> unix/apr_arch_proc_mutex.h
unix/shm.h -> unix/apr_arch_shm.h
unix/thread_cond.h -> unix/apr_arch_thread_cond.h
unix/thread_mutex.h -> unix/apr_arch_thread_mutex.h
unix/threadproc.h -> unix/apr_arch_threadproc.h
unix/thread_rwlock.h -> unix/apr_arch_thread_rwlock.h
win32/atime.h -> win32/apr_arch_atime.h
win32/dso.h -> win32/apr_arch_dso.h
win32/fileio.h -> win32/apr_arch_fileio.h
win32/inherit.h -> win32/apr_arch_inherit.h
win32/misc.h -> win32/apr_arch_misc.h
win32/networkio.h -> win32/apr_arch_networkio.h
win32/proc_mutex.h -> win32/apr_arch_proc_mutex.h
win32/thread_cond.h -> win32/apr_arch_thread_cond.h
win32/thread_mutex.h -> win32/apr_arch_thread_mutex.h
win32/threadproc.h -> win32/apr_arch_threadproc.h
win32/thread_rwlock.h -> win32/apr_arch_thread_rwlock.h
win32/utf8.h -> win32/apr_arch_utf8.h
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64271 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
No functional changes
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64251 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63743 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
so we shouldn't try to unlock the mutex.
Submitted by: Philip Martin <philip@codematters.co.uk>
Reviewed by: Aaron Bannert
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63742 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
which guarentees unnested lock behavior, keep APR_THREAD_MUTEX_DEFAULT
on Win32, Netware and OS2 as nested locks, leave Unix and BeOS with
unnested locks by default.
Needs an implementation on Netware and OS2 for UNNESTED locks, for now
return APR_ENOTIMPL.
Required for absolute locks in series for Win32 on the same thread,
since CriticalSection objects are blindingly fast without contention,
but they will always nest on the same thread.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63440 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
eliminate a conditional branch on platforms where PTHREAD_SETS_ERRNO
is not defined (at present, this means everything except OS/390)
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63307 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63117 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
with APR_HAS_THREADS.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63089 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62756 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
Submitted by: Brian Pane <brian.pane@cnet.com>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62746 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
Remove minor optimizations that were causing compile warnings.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62452 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
default not nested, but an init flag can enable them. I added a new test
to testlockperf to show how much faster non-nested mutexes are. I also
updated calls to apr_thread_mutex_init() wherever I could find them.
This patch only implements this for Unix (nested locks already existed
on Unix, so this patch just optionally enables/disables them). I did my
best to change the function declaration on other platforms, but someone
will have to double check me. Those other platforms will also have to
either enable nested locks (sometimes available in their thread
library) or just do what Unix does.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62435 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
Submitted by: Aaron Bannert <aaron@clove.org>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62377 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
header files, and add tell apr_want.h that we want mem functions.
Submitted by: Aaron Bannert <aaron@clove.org>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62291 13f79535-47bb-0310-9956-ffa450edef68
|
|
the locking API into separate APIs.
Submitted by: Aaron Bannert <aaron@clove.org>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62286 13f79535-47bb-0310-9956-ffa450edef68
|