From: Howard Chu Date: Thu, 24 Apr 2008 18:35:35 +0000 (+0000) Subject: ITS#5484 remove syncop from runq before freeing it X-Git-Tag: LOCKER_IDS~202 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=90a45655c2bc7a712bb77328e52a002573d5e1b2;p=openldap ITS#5484 remove syncop from runq before freeing it --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 9d7a9ad721..dade31d5aa 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -737,6 +737,13 @@ syncprov_free_syncop( syncops *so ) ldap_pvt_thread_mutex_unlock( &so->s_mutex ); return; } + if ( so->s_qtask ) { + ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex ); + if ( ldap_pvt_runqueue_isrunning( &slapd_rq, so->s_qtask ) ) + ldap_pvt_runqueue_stoptask( &slapd_rq, so->s_qtask ); + ldap_pvt_runqueue_remove( &slapd_rq, so->s_qtask ); + ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex ); + } ldap_pvt_thread_mutex_unlock( &so->s_mutex ); if ( so->s_flags & PS_IS_DETACHED ) { filter_free( so->s_op->ors_filter );