1 /* operation.c - routines to deal with pending ldap operations */
14 slap_op_free( Operation *op )
17 assert( op->o_next == NULL );
20 ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
22 if ( op->o_ber != NULL ) {
23 ber_free( op->o_ber, 1 );
25 if ( op->o_dn != NULL ) {
28 if ( op->o_ndn != NULL ) {
32 ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
33 ldap_pvt_thread_mutex_destroy( &op->o_abandonmutex );
48 op = (Operation *) ch_calloc( 1, sizeof(Operation) );
50 ldap_pvt_thread_mutex_init( &op->o_abandonmutex );
59 ldap_pvt_thread_mutex_lock( ¤ttime_mutex );
60 op->o_time = currenttime;
61 ldap_pvt_thread_mutex_unlock( ¤ttime_mutex );
63 op->o_connid = connid;
76 for ( tmp = olist; *tmp != NULL; tmp = &(*tmp)->o_next )
85 slap_op_remove( Operation **olist, Operation *op )
89 for ( tmp = olist; *tmp != NULL && *tmp != op; tmp = &(*tmp)->o_next )
93 Debug( LDAP_DEBUG_ANY, "op_delete: can't find op %ld\n",
98 *tmp = (*tmp)->o_next;
104 Operation * slap_op_pop( Operation **olist )
106 Operation *tmp = *olist;
109 *olist = tmp->o_next;