diff options
author | Justin Erenkrantz <jerenkrantz@apache.org> | 2001-07-19 00:11:57 +0000 |
---|---|---|
committer | Justin Erenkrantz <jerenkrantz@apache.org> | 2001-07-19 00:11:57 +0000 |
commit | a4329a474113db270c83c2e09328c129af03aa79 (patch) | |
tree | 6e38a0ef9167cc66fd0f8f1e707052f5bc3d9d9a /locks/os2 | |
parent | 5abd988593f38cfbccc6d79c3989430c58d20ee7 (diff) | |
download | apr-a4329a474113db270c83c2e09328c129af03aa79.tar.gz |
Add tryacquire function to the apr_lock_* stable.
(tryacquire will not block but return APR_EBUSY if the lock is held.)
Currently, I only implemented this on Unix for intraprocess locks
(as this is the only one I need right now). Other lock types on Unix
may well be able to support them (definitely interprocess pthread
mutex!).
All others platforms should return APR_ENOTIMPL for now until their
respective gurus add it (if they need it).
I wasn't sure if we could rely on EBUSY on all platforms, so I added
the APR_EBUSY constant.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@61965 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks/os2')
-rw-r--r-- | locks/os2/locks.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/locks/os2/locks.c b/locks/os2/locks.c index 3d7eed8a4..1417a828e 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -157,6 +157,11 @@ apr_status_t apr_lock_acquire(apr_lock_t *lock) return APR_OS2_STATUS(rc); } +apr_status_t apr_lock_tryacquire(apr_lock_t *lock) +{ + return APR_ENOTIMPL; +} + apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e) { switch (lock->type) { |