Commit 85ff0377 authored by Jong Hyuk Choi's avatar Jong Hyuk Choi
Browse files

runqueue locking fix (ITS#2746)

parent 4f003dbd
......@@ -174,12 +174,14 @@ ldap_pvt_runqueue_persistent_backload(
struct re_s* e;
int count = 0;
ldap_pvt_thread_mutex_lock( &rq->rq_mutex );
if ( !LDAP_STAILQ_EMPTY( &rq->task_list )) {
LDAP_STAILQ_FOREACH( e, &rq->task_list, tnext ) {
if ( e->next_sched.tv_sec == 0 )
count++;
}
}
ldap_pvt_thread_mutex_unlock( &rq->rq_mutex );
return count;
}
......@@ -1358,9 +1358,9 @@ slapd_daemon_task(
ldap_pvt_thread_pool_submit( &connection_pool,
rtask->routine, (void *) rtask );
}
ldap_pvt_thread_mutex_lock( &syncrepl_rq.rq_mutex );
rtask = ldap_pvt_runqueue_next_sched( &syncrepl_rq, &cat );
}
rtask = ldap_pvt_runqueue_next_sched( &syncrepl_rq, &cat );
ldap_pvt_thread_mutex_unlock( &syncrepl_rq.rq_mutex );
if ( cat != NULL ) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment