]> granicus.if.org Git - apache/commitdiff
The lock should have already been released when the connection was closed.
authorBradley Nicholes <bnicholes@apache.org>
Tue, 28 May 2002 19:32:30 +0000 (19:32 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Tue, 28 May 2002 19:32:30 +0000 (19:32 +0000)
If it was then releasing it again causes a "releasing an unheld lock" warning
on NetWare.  To avoid the warning, first try to get the lock before releasing
it.  The other alternative would be to just assume that the lock has been
released when the connection was closed so do nothing.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95323 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/util_ldap.c

index c9de56c6be9ab844ee7f6a84a4e220199033dee5..9bd7682b725d2b7ef91ec98dba328fc15247e6f5 100644 (file)
@@ -214,7 +214,14 @@ apr_status_t util_ldap_connection_destroy(void *param)
         ldc->ldap = NULL;
     }
 
-    /* release the lock we were using */
+    /* release the lock we were using.  The lock should have
+       already been released in the close connection call.  
+       But just in case it wasn't, we first try to get the lock
+       before unlocking it to avoid unlocking an unheld lock. 
+       Unlocking an unheld lock causes problems on NetWare.  The
+       other option would be to assume that close connection did
+       its job. */
+    apr_thread_mutex_trylock(ldc->lock);
     apr_thread_mutex_unlock(ldc->lock);
 
     return APR_SUCCESS;