From dd646eb7348e1054415e63621c5df39388d96a7e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 19 Apr 2005 14:40:30 +0000 Subject: [PATCH] Added ldap_pvt_runqueue_find() --- include/ldap_rq.h | 7 +++++++ libraries/libldap_r/rq.c | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/include/ldap_rq.h b/include/ldap_rq.h index d23c1d2535..551a1eada7 100644 --- a/include/ldap_rq.h +++ b/include/ldap_rq.h @@ -43,6 +43,13 @@ ldap_pvt_runqueue_insert( void *arg ); +LDAP_F( struct re_s* ) +ldap_pvt_runqueue_find( + struct runqueue_s* rq, + ldap_pvt_thread_start_t* routine, + void *arg +); + LDAP_F( void ) ldap_pvt_runqueue_remove( struct runqueue_s* rq, diff --git a/libraries/libldap_r/rq.c b/libraries/libldap_r/rq.c index 85ae1aa2db..bafb12166d 100644 --- a/libraries/libldap_r/rq.c +++ b/libraries/libldap_r/rq.c @@ -53,6 +53,22 @@ ldap_pvt_runqueue_insert( LDAP_STAILQ_INSERT_TAIL( &rq->task_list, entry, tnext ); } +struct re_s * +ldap_pvt_runqueue_find( + struct runqueue_s *rq, + ldap_pvt_thread_start_t *routine, + void *arg +) +{ + struct re_s* e; + + LDAP_STAILQ_FOREACH( e, &rq->task_list, tnext ) { + if ( e->routine == routine && e->arg == arg ) + return e; + } + return NULL; +} + void ldap_pvt_runqueue_remove( struct runqueue_s* rq, -- 2.39.5