summaryrefslogtreecommitdiff
path: root/locks/win32/proc_mutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'locks/win32/proc_mutex.c')
-rw-r--r--locks/win32/proc_mutex.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/locks/win32/proc_mutex.c b/locks/win32/proc_mutex.c
index 5ec9b2648..83042ce35 100644
--- a/locks/win32/proc_mutex.c
+++ b/locks/win32/proc_mutex.c
@@ -43,6 +43,10 @@ APR_DECLARE(apr_status_t) apr_proc_mutex_create(apr_proc_mutex_t **mutex,
HANDLE hMutex;
void *mutexkey;
+ if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) {
+ return APR_ENOTIMPL;
+ }
+
/* res_name_from_filename turns fname into a pseduo-name
* without slashes or backslashes, and prepends the \global
* prefix on Win2K and later
@@ -220,6 +224,11 @@ APR_DECLARE(const char *) apr_proc_mutex_lockfile(apr_proc_mutex_t *mutex)
return mutex->fname;
}
+APR_DECLARE(apr_lockmech_e) apr_proc_mutex_mech(apr_proc_mutex_t *mutex)
+{
+ return APR_LOCK_DEFAULT_TIMED;
+}
+
APR_DECLARE(const char *) apr_proc_mutex_name(apr_proc_mutex_t *mutex)
{
return apr_proc_mutex_defname();
@@ -236,20 +245,34 @@ APR_POOL_IMPLEMENT_ACCESSOR(proc_mutex)
/* Implement OS-specific accessors defined in apr_portable.h */
-APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex,
- apr_proc_mutex_t *mutex)
+APR_DECLARE(apr_status_t) apr_os_proc_mutex_get_ex(apr_os_proc_mutex_t *ospmutex,
+ apr_proc_mutex_t *pmutex,
+ apr_lockmech_e *mech)
{
*ospmutex = mutex->handle;
+ if (mech) {
+ *mech = APR_LOCK_DEFAULT_TIMED;
+ }
return APR_SUCCESS;
}
-APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex,
+APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex,
+ apr_proc_mutex_t *pmutex)
+{
+ return apr_os_proc_mutex_get_ex(ospmutex, pmutex, NULL);
+}
+
+APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex,
apr_os_proc_mutex_t *ospmutex,
+ apr_lockmech_e mech,
apr_pool_t *pool)
{
if (pool == NULL) {
return APR_ENOPOOL;
}
+ if (mech != APR_LOCK_DEFAULT && mech != APR_LOCK_DEFAULT_TIMED) {
+ return APR_ENOTIMPL;
+ }
if ((*pmutex) == NULL) {
(*pmutex) = (apr_proc_mutex_t *)apr_palloc(pool,
sizeof(apr_proc_mutex_t));
@@ -259,3 +282,10 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex,
return APR_SUCCESS;
}
+APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex,
+ apr_os_proc_mutex_t *ospmutex,
+ apr_pool_t *pool)
+{
+ return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED, pool);
+}
+