1 diff -ur mod_watch-4.3/mod_watch.c mod_watch-4.3-mutex/mod_watch.c
2 --- mod_watch-4.3/mod_watch.c 2011-03-28 14:15:48.017826697 +0200
3 +++ mod_watch-4.3-mutex/mod_watch.c 2011-03-28 14:07:07.613894883 +0200
8 + * WatchMutexMech directory
10 + * Mutex mechanism to use for shared memory lock.
13 +WatchMutexMech(cmd_parms *cmd, void *dconf, const char *mech)
15 + if (!strcasecmp(mech, "default")) {
16 + shMutexMech = APR_LOCK_DEFAULT;
18 +#if APR_HAS_FCNTL_SERIALIZE
19 + else if (!strcasecmp(mech, "fcntl") || !strcasecmp(mech, "file")) {
20 + shMutexMech = APR_LOCK_FCNTL;
23 +#if APR_HAS_FLOCK_SERIALIZE
24 + else if (!strcasecmp(mech, "flock") || !strcasecmp(mech, "file")) {
25 + shMutexMech = APR_LOCK_FLOCK;
28 +#if APR_HAS_POSIXSEM_SERIALIZE
29 + else if (!strcasecmp(mech, "posixsem") || !strcasecmp(mech, "sem")) {
30 + shMutexMech = APR_LOCK_POSIXSEM;
33 +#if APR_HAS_PROC_PTHREAD_SERIALIZE
34 + else if (!strcasecmp(mech, "pthread")) {
35 + shMutexMech = APR_LOCK_PROC_PTHREAD;
39 + return apr_pstrcat(cmd->pool, "Invalid WatchMutexMech argument ", mech,
40 + " (Valid WatchMutexMech mechanisms are: default"
41 +#if APR_HAS_FLOCK_SERIALIZE || APR_HAS_FCNTL_SERIALIZE
44 +#if APR_HAS_FLOCK_SERIALIZE
47 +#if APR_HAS_FCNTL_SERIALIZE
50 +#if APR_HAS_POSIXSEM_SERIALIZE
53 +#if APR_HAS_POSIXSEM_SERIALIZE
56 +#if APR_HAS_PROC_PTHREAD_SERIALIZE
61 + return (const char *) 0;
65 * WatchStateDirectory directory
67 * Absolute or server root relative directory where support and runtime
68 @@ -1645,6 +1702,11 @@
72 + "WatchMutexMech", WatchMutexMech, NULL, RSRC_CONF,
73 + "Mutex mechanism to use for shared memory lock."
77 "WatchStateDirectory", WatchStateDirectory, NULL, RSRC_CONF,
78 "Spool directory for any support and runtime files."
80 diff -ur mod_watch-4.3/SharedHash.c mod_watch-4.3-mutex/SharedHash.c
81 --- mod_watch-4.3/SharedHash.c 2011-03-28 14:15:48.017826697 +0200
82 +++ mod_watch-4.3-mutex/SharedHash.c 2011-03-28 14:06:00.950400565 +0200
84 const char shScanFormat[] = SH_SCAN_FORMAT;
85 const char shPrintFormat[] = SH_PRINT_FORMAT;
87 +int shMutexMech = APR_LOCK_DEFAULT;
89 #ifdef BOUNDARY_CHECKING
91 shVerifyString(struct shTable *tp, char *str)
94 rc = apr_global_mutex_create(
95 (apr_global_mutex_t **) &tp->mutex,
96 - tp->lockfile, APR_LOCK_DEFAULT, p
97 + tp->lockfile, shMutexMech, p
99 if (rc != APR_SUCCESS) {
101 diff -ur mod_watch-4.3/SharedHash.h mod_watch-4.3-mutex/SharedHash.h
102 --- mod_watch-4.3/SharedHash.h 2003-03-14 10:12:48.000000000 +0100
103 +++ mod_watch-4.3-mutex/SharedHash.h 2011-03-28 14:04:55.726981348 +0200
108 +extern int shMutexMech;
110 extern const char shLockFile[];
111 extern const char shScanFormat[];
112 extern const char shPrintFormat[];