| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1905414 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
* test/testlock.c(thread_mutex_function,
thread_mutex_sleep_function):
Thread (APR_THREAD_FUNC) functions should return a pointer (NULL).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902181 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
unlocking succeed.
Catch thread join errors and thread exit status throughout.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1891203 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
behaviour by relocking a non-recursive mutex; spawn a thread to hold
the lock.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1878357 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1866712 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
| |
expected.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1866300 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860190 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1860163 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
checking timeout precision; 100ms failed regularly in Fedora builds,
500ms has Never Failed(TM).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1808910 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1790569 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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/trunk@1790488 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/trunk@1790107 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667900 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
Netware BASEDIR changes?
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@513263 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
relocate the install files
Submitted by: Guenter Knauf <fuankg apache org>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@502048 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the pool it was allocated from.
Submitted by: Evgueni Brevnov <evgueni.brevnov gmail.com>
* locks/win32/thread_rwlock.c
(apr_thread_rwlock_destroy): Use apr_pool_cleanup_run to call our cleanup
function.
(thread_rwlock_cleanup): Put the destruction of the rwlock here instead
of in the destructor function.
* test/testlock.c
(test_thread_rwlocks): Destroy the rwlock explicitly so we can see this
kind of problem.
* CHANGES: Note change.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@371172 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@151412 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
delete the lock when we're done and all is well again.
As the tests don't run in isolation there may be other places we should
clean up better.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65245 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
testutil.c reported. Not very useful. This change adds the passing of
the (correct) line number and also a macro to ease said passing.
I've changed all instances of apr_assert_success to use the new macro, but
not all the tests build on this platform so others should check that all
is well for them.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65171 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65128 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
a test that is segfaulting in testshm. That will need to be fixed.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65095 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
and it prints output while running the test. Also, if a test fails the
rest of the test function is run, allowing for proper cleanup. Finally,
it is possible to call the same function multiple times with different
data, and each call is considered a separate test.
This is the first of a multi-step process to get a more useful test suite.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65091 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64904 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
undefined results in a POSIX implementation.
* locks/unix/thread_cond.c (apr_thread_cond_create): Don't run cleanup
if pthread_cond_init fails since that gives undefined results.
(apr_thread_cond_destroy): Use apr_pool_cleanup_run so the cleanup is
always unregistered.
* test/testlock.c (test_cond): Test apr_thread_cond_destroy and use
apr_assert_success() a little more.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64848 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
|
|
|
|
|
|
|
|
| |
CuTest sources. This keeps the CuTest sources clean of any knowledge about
APR.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64126 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
failing on various platforms.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64122 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64113 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63565 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
aren't implemented (e.g., Darwin); there is still useful stuff to test
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63251 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63232 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63117 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
| |
and get rid of apr_lock_create_np(); apr_lock_create() has a new
parameter for specifying the lock mechanism (or APR_LOCK_DEFAULT to let
APR choose)
(same for apr_proc_mutex_create_np() and apr_proc_mutex_create())
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62684 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
| |
calling pthread_cond_timedwait() (and thus
apr_thread_cond_timedwait()) without holding the mutex,
you can't on AIX; the system recognizes the error and
returns EINVAL
so fix the testlock program to grab the mutex
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62595 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
|
|
|
|
|
|
|
| |
they all return apr_status_t.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62422 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62421 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sets the timer at 5 seconds. No signals are thrown. Measures the time
that we were asleep.
- If the timer comes back early with APR_TIMEUP, then it passes.
- If it comes back more than 100ms late, it fails.
(We may wish to fool with the timeout leeway, I think 100ms is pretty
generous, especially since the timeout is supposed to be a maximum.)
- If it comes back and there is no error, we try again (up to 5 times) since
it was probably just a spurious wakeup.
- If we get an error that is not APR_TIMEUP, it failed.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62420 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
This puts it back in, but it also makes a failure non-terminal.
Read/write locks were not implemented for the old API on Windows,
but they are using the new API, so this failure can't be
terminal, because if it is, the new API isn't tested.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62328 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
This should work on versions of VC++ as well.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62326 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
This does Unix, and provides stubs for all other platforms.
Submitted by: Aaron Bannert <aaron@clove.org>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62317 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
|
| |
old one. This allows people porting platforms to the new API to
easily determine when they get it right.
Submitted by: Aaron Bannert <aaron@clove.org>
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62301 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
|
| |
when the current directory is a mount which will not support
a lock (e.g., some NFS), -f /tmp/mylock can be used to
circumvent the problem
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62261 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
success
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62073 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
| |
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62040 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
|
| |
of the tests to have the least implemented at the end. Also now has better
output and errors are preserved shown.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61727 13f79535-47bb-0310-9956-ffa450edef68
|
|
|
|
|
|
|
| |
thread a number of times. Win32 and OS/2 don't have the changes yet.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61717 13f79535-47bb-0310-9956-ffa450edef68
|
|
rw locks on Unix platforms. This is based on earlier patches that I
posted to apr-dev, but did not receive feedback from others on.
Hence, I'm committing.
This will require a buildconf run for those of you who use Unix.
This has only really been tested on Solaris, but it should work
for those platforms that have POSIX rw locks. Other Unix
platforms will simply return APR_ENOTIMPL.
Add apr_lock_acquire_rw(). Notice that the Unix implementation
will only allow a readwrite lock to be acquired via this function.
Technically, apr_lock_acquire could obtain some sort of readwrite
lock in this case, but that might lead to confusion.
Added test/testlock.c which will attempt to test *both* APR_MUTEX
and APR_READWRITE. This was based off of the testthread.c, but has
been rewritten to use the new stdin/stdout/stderr code and just
make more sense overall. testthread.c should probably be rewritten
to test threading more specifically.
Added framework that will hopefully still let BeOS, OS/2, and Win32
compile. Any operation relating to an APR_READWRITE lock on these
platforms should just return APR_ENOTIMPL until the appropriate
people get around to it. Some structure has been added to make what
they have to implement fairly obvious. Again, I hope it compiles,
but I can't guarantee it.
Christian Gross has a Win32 readwrite lock patch floating around,
but I can't vouch for Win32 code. The other platforms probably
have ways to do it, but I'm not sure what they are.
(Sorry, I write long commit messages...)
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61682 13f79535-47bb-0310-9956-ffa450edef68
|