Commit 5ad6ab35 authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

ITS#8958 rename ldap_pvt_thread_pool_pausecheck()

to ..._pausewait() since that's what it really does.
Add ..._pausequery() that only checks and doesn't wait.
parent 81ed9e0d
......@@ -279,7 +279,11 @@ ldap_pvt_thread_pool_unidle LDAP_P((
ldap_pvt_thread_pool_t *pool ));
LDAP_F( int )
ldap_pvt_thread_pool_pausecheck LDAP_P((
ldap_pvt_thread_pool_pausequery LDAP_P((
ldap_pvt_thread_pool_t *pool ));
LDAP_F( int )
ldap_pvt_thread_pool_pausewait LDAP_P((
ldap_pvt_thread_pool_t *pool ));
LDAP_F( int )
......
......@@ -1236,11 +1236,26 @@ ldap_pvt_thread_pool_unidle( ldap_pvt_thread_pool_t *tpool )
* Return 1 if we waited, 0 if not, -1 at parameter error.
*/
int
ldap_pvt_thread_pool_pausecheck( ldap_pvt_thread_pool_t *tpool )
ldap_pvt_thread_pool_pausewait( ldap_pvt_thread_pool_t *tpool )
{
return handle_pause(tpool, PAUSE_ARG(CHECK_PAUSE));
}
/* Return 1 if a pause has been requested */
int
ldap_pvt_thread_pool_pausequery( ldap_pvt_thread_pool_t *tpool )
{
struct ldap_int_thread_pool_s *pool;
if ( !tpool )
return -1;
pool = *tpool;
if ( !pool )
return 0;
return pool->ltp_pause != 0;
}
/*
* Wait for a pause, from a non-pooled thread.
*/
......
......@@ -765,7 +765,7 @@ accesslog_purge( void *ctx, void *arg )
}
ch_free( pd.ndn[i].bv_val );
ch_free( pd.dn[i].bv_val );
ldap_pvt_thread_pool_pausecheck( &connection_pool );
ldap_pvt_thread_pool_pausewait( &connection_pool );
}
ch_free( pd.ndn );
ch_free( pd.dn );
......
......@@ -2723,7 +2723,7 @@ retry:
if ( slapd_shutdown )
return SLAPD_ABANDON;
if ( !ldap_pvt_thread_pool_pausecheck( &connection_pool ))
if ( !ldap_pvt_thread_pool_pausewait( &connection_pool ))
ldap_pvt_thread_yield();
ldap_pvt_thread_mutex_lock( &mt->mt_mutex );
......@@ -3112,7 +3112,7 @@ syncprov_op_search( Operation *op, SlapReply *rs )
ch_free( sop );
return SLAPD_ABANDON;
}
if ( !ldap_pvt_thread_pool_pausecheck( &connection_pool ))
if ( !ldap_pvt_thread_pool_pausewait( &connection_pool ))
ldap_pvt_thread_yield();
ldap_pvt_thread_mutex_lock( &si->si_ops_mutex );
}
......
......@@ -1210,7 +1210,7 @@ get_pmutex(
while ( ldap_pvt_thread_mutex_trylock( &si->si_cookieState->cs_pmutex )) {
if ( slapd_shutdown )
return SYNC_SHUTDOWN;
if ( !ldap_pvt_thread_pool_pausecheck( &connection_pool ))
if ( !ldap_pvt_thread_pool_pausewait( &connection_pool ))
ldap_pvt_thread_yield();
}
}
......@@ -1972,7 +1972,7 @@ do_syncrepl(
while ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) {
if ( slapd_shutdown )
return NULL;
if ( !ldap_pvt_thread_pool_pausecheck( &connection_pool ))
if ( !ldap_pvt_thread_pool_pausewait( &connection_pool ))
ldap_pvt_thread_yield();
}
......
Markdown is supported
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