/* $OpenLDAP$ */
/*
- * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
+ * Copyright 1998-2002 The OpenLDAP Foundation, Redwood City, California, USA
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted only
static ldap_pvt_thread_mutex_t ldap_pvt_thread_pool_mutex;
-static void *ldap_int_thread_pool_wrapper(
- struct ldap_int_thread_pool_s *pool );
+static void *ldap_int_thread_pool_wrapper( void *pool );
int
ldap_int_thread_pool_startup ( void )
pool->ltp_open_count++;
ldap_pvt_thread_t thr;
- rc = ldap_pvt_thread_create( &thr, 1,
- (void *) ldap_int_thread_pool_wrapper, pool );
+ rc = ldap_pvt_thread_create( &thr, 1, ldap_int_thread_pool_wrapper, pool );
if( rc != 0) {
/* couldn't start one? then don't start any */
ldap_pvt_thread_mutex_unlock(&ldap_pvt_thread_pool_mutex);
ldap_pvt_thread_cond_destroy(&pool->ltp_cond);
ldap_pvt_thread_mutex_destroy(&pool->ltp_mutex);
- free(pool);
+ LDAP_FREE(pool);
return(-1);
}
#endif
if (need_thread) {
int rc = ldap_pvt_thread_create( &thr, 1,
- (void *)ldap_int_thread_pool_wrapper, pool );
+ ldap_int_thread_pool_wrapper, pool );
ldap_pvt_thread_mutex_lock(&pool->ltp_mutex);
if (rc == 0) {
pool->ltp_starting--;
ldap_int_thread_ctx_s, ltc_next.q);
pool->ltp_pending_count++;
ldap_pvt_thread_mutex_unlock(&pool->ltp_mutex);
- free(ctx);
+ LDAP_FREE(ctx);
return(-1);
}
}
while ((ctx = LDAP_STAILQ_FIRST(&pool->ltp_pending_list)) != NULL)
{
LDAP_STAILQ_REMOVE_HEAD(&pool->ltp_pending_list, ltc_next.q);
- free(ctx);
+ LDAP_FREE(ctx);
}
while ((ctx = LDAP_SLIST_FIRST(&pool->ltp_free_list)) != NULL)
{
LDAP_SLIST_REMOVE_HEAD(&pool->ltp_free_list, ltc_next.l);
- free(ctx);
+ LDAP_FREE(ctx);
}
ldap_pvt_thread_cond_destroy(&pool->ltp_cond);
ldap_pvt_thread_mutex_destroy(&pool->ltp_mutex);
- free(pool);
+ LDAP_FREE(pool);
return(0);
}
static void *
ldap_int_thread_pool_wrapper (
- struct ldap_int_thread_pool_s *pool )
+ void *xpool )
{
+ struct ldap_int_thread_pool_s *pool = xpool;
ldap_int_thread_ctx_t *ctx;
if (pool == NULL)