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
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;