* test/testthread.c: Use a user-range apr_status_t value for the
  test thread exit code.
  (thread_func1): Exit if mutex lock/unlock fails.


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1884544 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/testthread.c b/test/testthread.c
index f3df367..e64bdd4 100644
--- a/test/testthread.c
+++ b/test/testthread.c
@@ -33,7 +33,7 @@
 static apr_thread_t *t4;
 
 /* just some made up number to check on later */
-static apr_status_t exit_ret_val = 123;
+static apr_status_t exit_ret_val = (APR_OS_START_USERERR + 123);
 
 static void init_func(void)
 {
@@ -42,14 +42,17 @@
 
 static void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data)
 {
+    apr_status_t rv;
     int i;
 
     apr_thread_once(control, init_func);
 
     for (i = 0; i < 10000; i++) {
-        apr_thread_mutex_lock(thread_lock);
+        rv = apr_thread_mutex_lock(thread_lock);
+        if (rv != APR_SUCCESS) apr_thread_exit(thd, rv);
         x++;
-        apr_thread_mutex_unlock(thread_lock);
+        rv = apr_thread_mutex_unlock(thread_lock);
+        if (rv != APR_SUCCESS) apr_thread_exit(thd, rv);
     }
     apr_thread_exit(thd, exit_ret_val);
     return NULL;