Commit 06670f3c authored by Bradley Nicholes's avatar Bradley Nicholes
Browse files

The lock should have already been released when the connection was closed.

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
parent 4c19aa85
Loading
Loading
Loading
Loading
+8 −1
Changes for modules/experimental/util_ldap.c: 8 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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;