aboutsummaryrefslogtreecommitdiff
path: root/include/apr_global_mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/apr_global_mutex.h')
-rw-r--r--include/apr_global_mutex.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h
index 90d9c55b0484..e3cba23ff202 100644
--- a/include/apr_global_mutex.h
+++ b/include/apr_global_mutex.h
@@ -29,6 +29,7 @@
#if APR_PROC_MUTEX_IS_GLOBAL
#include "apr_proc_mutex.h"
#endif
+#include "apr_time.h"
#ifdef __cplusplus
extern "C" {
@@ -66,6 +67,7 @@ typedef struct apr_global_mutex_t apr_global_mutex_t;
* APR_LOCK_POSIXSEM
* APR_LOCK_PROC_PTHREAD
* APR_LOCK_DEFAULT pick the default mechanism for the platform
+ * APR_LOCK_DEFAULT_TIMED pick the default timed mechanism
* </PRE>
* @param pool the pool from which to allocate the mutex.
* @warning Check APR_HAS_foo_SERIALIZE defines to see if the platform supports
@@ -109,6 +111,17 @@ APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex);
APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex);
/**
+ * Attempt to acquire the lock for the given mutex until timeout expires.
+ * If the acquisition time outs, the call returns with APR_TIMEUP.
+ * @param mutex the mutex on which to attempt the lock acquiring.
+ * @param timeout the relative timeout (microseconds).
+ * @note A negative or nul timeout means immediate attempt, returning
+ * APR_TIMEUP without blocking if it the lock is already acquired.
+ */
+APR_DECLARE(apr_status_t) apr_global_mutex_timedlock(apr_global_mutex_t *mutex,
+ apr_interval_time_t timeout);
+
+/**
* Release the lock for the given mutex.
* @param mutex the mutex from which to release the lock.
*/