summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-02-22 07:09:26 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-02-22 07:09:26 +0000
commit6bc1854003718dad4dafabaa7a8be64d78891d5a (patch)
treef08eb6dad987dda524aca3d009ce747628d912e6 /include
parent65c44be4fe792f9830a25c6cbdd62aeb3de68558 (diff)
downloadlibapr-6bc1854003718dad4dafabaa7a8be64d78891d5a.tar.gz
Per Aaron's consent that there is no more rational way to optimize this
relationship - allow Win32/Netware [and perhaps, some unix-ish platforms that don't have a 'proc lock not typesafe' construct] to 'borrow' the proc_mutex code. Because the apr_thread_lock_create call differs so significantly, global locks can never be implemented in terms of thread locks [as well as the converse.] git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63050 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r--include/apr.h.in3
-rw-r--r--include/apr.hnw2
-rw-r--r--include/apr.hw3
-rw-r--r--include/apr_global_mutex.h20
4 files changed, 28 insertions, 0 deletions
diff --git a/include/apr.h.in b/include/apr.h.in
index 98a7cccd6..22aa40dfa 100644
--- a/include/apr.h.in
+++ b/include/apr.h.in
@@ -258,6 +258,9 @@ typedef @socklen_t_value@ apr_socklen_t;
/* are we going to force the generic atomic operations */
#define APR_FORCE_ATOMIC_GENERIC @apr_force_atomic_generic@
+/* ### aught to actual deploy this for OS2? */
+#define APR_PROC_MUTEX_IS_GLOBAL 0
+
/* Local machine definition for console and log output. */
#define APR_EOL_STR "@eolstr@"
diff --git a/include/apr.hnw b/include/apr.hnw
index 882cf0c32..1fa3e2b2f 100644
--- a/include/apr.hnw
+++ b/include/apr.hnw
@@ -256,6 +256,8 @@ typedef unsigned short nuint16;
#define LOBYTE NGetLo8
#endif
+/* PROC mutex is a GLOBAL mutex on Netware */
+#define APR_PROC_MUTEX_IS_GLOBAL 1
/* Definitions that APR programs need to work properly. */
diff --git a/include/apr.hw b/include/apr.hw
index 82f3d20f4..2935f37d1 100644
--- a/include/apr.hw
+++ b/include/apr.hw
@@ -410,6 +410,9 @@ typedef struct apr_lock_t apr_lock_t;
/* Local machine definition for console and log output. */
#define APR_EOL_STR "\r\n"
+/* No difference between PROC and GLOBAL mutex */
+#define APR_PROC_MUTEX_IS_GLOBAL 1
+
typedef int apr_wait_t;
/* struct iovec is needed to emulate Unix writev */
diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h
index 56e39bad4..fc5a0b3b6 100644
--- a/include/apr_global_mutex.h
+++ b/include/apr_global_mutex.h
@@ -75,6 +75,8 @@ extern "C" {
* @{
*/
+#if !APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN)
+
typedef struct apr_global_mutex_t apr_global_mutex_t;
/* Function definitions */
@@ -157,6 +159,24 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex);
*/
APR_POOL_DECLARE_ACCESSOR(global_mutex);
+#else /* APR_PROC_MUTEX_IS_GLOBAL */
+
+/* Some platforms [e.g. Win32] have cross process locks that are truly
+ * global locks, since there isn't the concept of cross-process locks.
+ * Define these platforms in terms of an apr_proc_mutex_t.
+ */
+
+#define apr_global_mutex_t apr_proc_mutex_t
+#define apr_global_mutex_create apr_proc_mutex_create
+#define apr_global_mutex_child_init apr_proc_mutex_child_init
+#define apr_global_mutex_lock apr_proc_mutex_lock
+#define apr_global_mutex_trylock apr_proc_mutex_trylock
+#define apr_global_mutex_unlock apr_proc_mutex_unlock
+#define apr_global_mutex_destroy apr_proc_mutex_destroy
+#define apr_global_mutex_pool_get apr_proc_mutex_pool_get
+
+#endif
+
#ifdef __cplusplus
}
#endif