mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 15:49:34 -05:00
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.
This commit is contained in:
parent
81ed9e0d0e
commit
5ad6ab3568
5 changed files with 26 additions and 7 deletions
|
|
@ -279,7 +279,11 @@ ldap_pvt_thread_pool_unidle LDAP_P((
|
||||||
ldap_pvt_thread_pool_t *pool ));
|
ldap_pvt_thread_pool_t *pool ));
|
||||||
|
|
||||||
LDAP_F( int )
|
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_pvt_thread_pool_t *pool ));
|
||||||
|
|
||||||
LDAP_F( int )
|
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.
|
* Return 1 if we waited, 0 if not, -1 at parameter error.
|
||||||
*/
|
*/
|
||||||
int
|
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 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.
|
* 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.ndn[i].bv_val );
|
||||||
ch_free( pd.dn[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.ndn );
|
||||||
ch_free( pd.dn );
|
ch_free( pd.dn );
|
||||||
|
|
|
||||||
|
|
@ -2723,7 +2723,7 @@ retry:
|
||||||
if ( slapd_shutdown )
|
if ( slapd_shutdown )
|
||||||
return SLAPD_ABANDON;
|
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_yield();
|
||||||
ldap_pvt_thread_mutex_lock( &mt->mt_mutex );
|
ldap_pvt_thread_mutex_lock( &mt->mt_mutex );
|
||||||
|
|
||||||
|
|
@ -3112,7 +3112,7 @@ syncprov_op_search( Operation *op, SlapReply *rs )
|
||||||
ch_free( sop );
|
ch_free( sop );
|
||||||
return SLAPD_ABANDON;
|
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_yield();
|
||||||
ldap_pvt_thread_mutex_lock( &si->si_ops_mutex );
|
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 )) {
|
while ( ldap_pvt_thread_mutex_trylock( &si->si_cookieState->cs_pmutex )) {
|
||||||
if ( slapd_shutdown )
|
if ( slapd_shutdown )
|
||||||
return SYNC_SHUTDOWN;
|
return SYNC_SHUTDOWN;
|
||||||
if ( !ldap_pvt_thread_pool_pausecheck( &connection_pool ))
|
if ( !ldap_pvt_thread_pool_pausewait( &connection_pool ))
|
||||||
ldap_pvt_thread_yield();
|
ldap_pvt_thread_yield();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1972,7 +1972,7 @@ do_syncrepl(
|
||||||
while ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) {
|
while ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) {
|
||||||
if ( slapd_shutdown )
|
if ( slapd_shutdown )
|
||||||
return NULL;
|
return NULL;
|
||||||
if ( !ldap_pvt_thread_pool_pausecheck( &connection_pool ))
|
if ( !ldap_pvt_thread_pool_pausewait( &connection_pool ))
|
||||||
ldap_pvt_thread_yield();
|
ldap_pvt_thread_yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue