LDAP_STAILQ_FOREACH( o, &conn->c_ops, o_next ) {
if ( o->o_msgid == id ) {
- ldap_pvt_thread_mutex_lock( &o->o_abandonmutex );
o->o_abandon = 1;
- ldap_pvt_thread_mutex_unlock( &o->o_abandonmutex );
goto done;
}
}
int attrsonly )
{
struct bdb_info *bdb = (struct bdb_info *) be->be_private;
- int abandon;
int rc;
const char *text = NULL;
time_t stoptime;
int scopeok = 0;
/* check for abandon */
- ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
- abandon = op->o_abandon;
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
-
- if ( abandon ) {
+ if ( op->o_abandon ) {
rc = 0;
goto done;
}
}
/* check for abandon */
- ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
- rc = op->o_abandon;
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
- if ( rc ) {
+ if ( op->o_abandon ) {
rc = SLAPD_ABANDON;
goto exit;
}
#endif
/* check for abandon */
- ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
if ( op->o_abandon ) {
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
goto return_results;
}
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
if ( ( rc_id = dn2id ( be, &new_ndn, &id ) ) || id != NOID ) {
/* if (rc_id) something bad happened to ldbm cache */
send_ldap_result( conn, op,
/* check for abandon */
- ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
if ( op->o_abandon ) {
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
goto return_results;
}
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
/* delete old one */
if ( dn2id_delete( be, &e->e_nname, e->e_id ) != 0 ) {
int scopeok = 0;
/* check for abandon */
- ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
-
if ( op->o_abandon ) {
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
rc = 0;
goto done;
}
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
-
/* check time limit */
if ( tlimit != -1 && slap_get_time() > stoptime ) {
send_search_result( conn, op, LDAP_TIMELIMIT_EXCEEDED,
int ab, gotit = 0;
/* check for abandon */
- ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
ab = op->o_abandon;
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
for ( i = 0, lsc = lc->conns; lsc[ 0 ] != NULL; lsc++, i++ ) {
if ( lsc[ 0 ]->candidate != META_CANDIDATE ) {
#if 0 /* need op */
/* check for abandon */
- ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
if ( op->o_abandon ) {
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
rc = SLAPD_ABANDON;
goto cleanup;
for ( pw = getpwent(); pw != NULL; pw = getpwent() ) {
/* check for abandon */
- ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
if ( op->o_abandon ) {
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
endpwent();
return( -1 );
}
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
/* check time limit */
if ( slap_get_time() > stoptime ) {
#include <stdio.h>
-#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/string.h>
for(eid=srch_info.id_list;eid!=NULL;eid=eid->next)
{
/* check for abandon */
- ldap_pvt_thread_mutex_lock(&op->o_abandonmutex);
if (op->o_abandon)
{
- ldap_pvt_thread_mutex_unlock(&op->o_abandonmutex);
break;
}
- ldap_pvt_thread_mutex_unlock(&op->o_abandonmutex);
/* check time limit */
if ( tlimit != -1 && slap_get_time() > stoptime)
)
{
GroupAssertion *g;
- int i;
- ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
- i = op->o_abandon;
- ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
- if (i) return SLAPD_ABANDON;
+ if ( op->o_abandon ) return SLAPD_ABANDON;
if ( !dn_match( &target->e_nname, gr_ndn ) ) {
/* we won't attempt to send it to a different backend */
break;
}
}
+ rc = 0;
/*
* check for abandon
*/
- ldap_pvt_thread_mutex_lock (&op->o_abandonmutex);
- rc = op->o_abandon;
- ldap_pvt_thread_mutex_unlock (&op->o_abandonmutex);
- if (rc) {
- rc = 0;
+ if (op->o_abandon) {
goto done;
}
be = gi->n[i].be;
#include <ac/socket.h>
#include <ac/errno.h>
-#include <ac/signal.h>
#include <ac/string.h>
#include <ac/time.h>
#include <ac/unistd.h>
Operation *o;
LDAP_STAILQ_FOREACH(o, &c->c_ops, o_next) {
- ldap_pvt_thread_mutex_lock( &o->o_abandonmutex );
o->o_abandon = 1;
- ldap_pvt_thread_mutex_unlock( &o->o_abandonmutex );
}
/* remove pending operations */
#include <ac/ctype.h>
#include <ac/errno.h>
-#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
#include <stdio.h>
-#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
ldap_controls_free( op->o_ctrls );
}
- ldap_pvt_thread_mutex_destroy( &op->o_abandonmutex );
-
free( (char *) op );
}
op = (Operation *) ch_calloc( 1, sizeof(Operation) );
- ldap_pvt_thread_mutex_init( &op->o_abandonmutex );
-
op->o_ber = ber;
op->o_msgid = msgid;
op->o_tag = tag;
#include <ac/socket.h>
#include <ac/errno.h>
-#include <ac/signal.h>
#include <ac/string.h>
#include <ac/ctype.h>
#include <ac/time.h>
#include <ac/socket.h>
#include <ac/errno.h>
-#include <ac/signal.h>
#include <ac/string.h>
#include <ac/ctype.h>
#include <ac/time.h>
goto FINISHED;
suffix_alias( be, &searchbase );
- ldap_pvt_thread_mutex_init( &op.o_abandonmutex );
op.o_tag = LDAP_REQ_SEARCH;
op.o_protocol = LDAP_VERSION3;
op.o_ndn = *saslname;
scope, /*deref=*/1, /*sizelimit=*/1, /*time=*/0, filter, /*fstr=*/NULL,
/*attrs=*/NULL, /*attrsonly=*/0 );
- ldap_pvt_thread_mutex_destroy( &op.o_abandonmutex );
-
FINISHED:
if( searchbase.bv_len ) ch_free( searchbase.bv_val );
if( filter ) filter_free( filter );
sm.match = 0;
cb.sc_private = &sm;
- ldap_pvt_thread_mutex_init( &op.o_abandonmutex );
op.o_tag = LDAP_REQ_SEARCH;
op.o_protocol = LDAP_VERSION3;
op.o_ndn = *authc;
scope, /*deref=*/1, /*sizelimit=*/0, /*time=*/0, filter, /*fstr=*/NULL,
/*attrs=*/NULL, /*attrsonly=*/0 );
- ldap_pvt_thread_mutex_destroy( &op.o_abandonmutex );
-
if (sm.match)
rc = LDAP_SUCCESS;
else
#include <sys/types.h>
#include <ac/syslog.h>
#include <ac/regex.h>
+#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/time.h>
#include <ac/param.h>
ldap_pvt_thread_t o_tid; /* thread handling this op */
- ldap_pvt_thread_mutex_t o_abandonmutex; /* protects o_abandon */
- char o_abandon; /* abandon flag */
+ volatile sig_atomic_t o_abandon; /* abandon flag */
#define SLAP_NO_CONTROL 0
#define SLAP_NONCRITICAL_CONTROL 1