summaryrefslogtreecommitdiff
path: root/test/globalmutexchild.c
diff options
context:
space:
mode:
authorJustin Erenkrantz <jerenkrantz@apache.org>2004-06-04 08:44:15 +0000
committerJustin Erenkrantz <jerenkrantz@apache.org>2004-06-04 08:44:15 +0000
commitcc7a365f53eb858c6d1056f358f6e5e0fe37a8bd (patch)
tree6236288b403d01d51b7461fa722dd8c14c7861e7 /test/globalmutexchild.c
parenta548c13fe173659e7375b78e7cb7885fe91ddcc3 (diff)
downloadapr-cc7a365f53eb858c6d1056f358f6e5e0fe37a8bd.tar.gz
Various test suite improvements to actually test the global mutex code with all
of the available methods. abts.c: Properly strip prefix and .c extension (was broken if . character is in your path!); specify 'testfoo' rather than 'path/to/testfoo' now globalmutexchild.c: Pass along the mutex mechanism to the child via args[1]. testglobalmutex.c: Invoke test for every global mutex method available. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@65148 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/globalmutexchild.c')
-rw-r--r--test/globalmutexchild.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/globalmutexchild.c b/test/globalmutexchild.c
index 34ba178db..c4032bf41 100644
--- a/test/globalmutexchild.c
+++ b/test/globalmutexchild.c
@@ -29,13 +29,24 @@ int main(int argc, const char * const argv[])
{
apr_pool_t *p;
int i = 0;
+ apr_lockmech_e mech;
apr_global_mutex_t *global_lock;
+ apr_status_t rv;
apr_initialize();
atexit(apr_terminate);
apr_pool_create(&p, NULL);
- apr_global_mutex_create(&global_lock, LOCKNAME, APR_LOCK_DEFAULT, p);
+ if (argc >= 2) {
+ mech = (apr_lockmech_e)apr_strtoi64(argv[1], NULL, 0);
+ }
+ else {
+ mech = APR_LOCK_DEFAULT;
+ }
+ rv = apr_global_mutex_create(&global_lock, LOCKNAME, mech, p);
+ if (rv != APR_SUCCESS) {
+ exit(-rv);
+ }
apr_global_mutex_child_init(&global_lock, LOCKNAME, p);
while (1) {