connection_acquire_nolock_ext(Connection *conn, int allow_when_closing)
{
    /* connection in the closing state can't be acquired */
    if (!allow_when_closing && (conn->c_flags & CONN_FLAG_CLOSING)) {
        /* This may happen while other threads are still working on this connection */
        slapi_log_err(SLAPI_LOG_ERR, "connection_acquire_nolock_ext",
                      "conn=%" PRIu64 " fd=%d Attempt to acquire connection in the closing state\n",
                      conn->c_connid, conn->c_sd);
        return -1;
    } else {
        conn->c_refcnt++;
        return 0;
    }
}
connection_acquire_nolock_ext(Connection *conn, int allow_when_closing)
{
     
    if (!allow_when_closing && (conn->c_flags & CONN_FLAG_CLOSING)) {
         
        slapi_log_err(SLAPI_LOG_ERR, "connection_acquire_nolock_ext",
                      "conn=%" PRIu64 " fd=%d Attempt to acquire connection in the closing state\n",
                      conn->c_connid, conn->c_sd);
        return -1;
    } else {
        conn->c_refcnt++;
        return 0;
    }
}