--- libeio/etp.c 2015/06/25 20:41:03 1.9 +++ libeio/etp.c 2016/05/01 17:15:45 1.11 @@ -37,6 +37,15 @@ * either the BSD or the GPL. */ +#if HAVE_SYS_PRCTL_H +# include +#endif + +#ifdef EIO_STACKSIZE +# define X_STACKSIZE EIO_STACKSIZE +#endif +#include "xthread.h" + #ifndef ETP_API_DECL # define ETP_API_DECL static #endif @@ -311,7 +320,7 @@ { #if HAVE_PRCTL_SET_NAME /* provide a more sensible "thread name" */ - char name[16 + 1]; + char name[15 + 1]; const int namelen = sizeof (name) - 1; int len; @@ -588,10 +597,10 @@ } ETP_API_DECL void ecb_cold -etp_set_max_poll_time (etp_pool pool, double nseconds) +etp_set_max_poll_time (etp_pool pool, double seconds) { if (WORDACCESS_UNSAFE) X_LOCK (pool->reslock); - pool->max_poll_time = nseconds * ETP_TICKS; + pool->max_poll_time = seconds * ETP_TICKS; if (WORDACCESS_UNSAFE) X_UNLOCK (pool->reslock); } @@ -604,10 +613,10 @@ } ETP_API_DECL void ecb_cold -etp_set_max_idle (etp_pool pool, unsigned int nthreads) +etp_set_max_idle (etp_pool pool, unsigned int threads) { if (WORDACCESS_UNSAFE) X_LOCK (pool->reqlock); - pool->max_idle = nthreads; + pool->max_idle = threads; if (WORDACCESS_UNSAFE) X_UNLOCK (pool->reqlock); } @@ -620,17 +629,17 @@ } ETP_API_DECL void ecb_cold -etp_set_min_parallel (etp_pool pool, unsigned int nthreads) +etp_set_min_parallel (etp_pool pool, unsigned int threads) { - if (pool->wanted < nthreads) - pool->wanted = nthreads; + if (pool->wanted < threads) + pool->wanted = threads; } ETP_API_DECL void ecb_cold -etp_set_max_parallel (etp_pool pool, unsigned int nthreads) +etp_set_max_parallel (etp_pool pool, unsigned int threads) { - if (pool->wanted > nthreads) - pool->wanted = nthreads; + if (pool->wanted > threads) + pool->wanted = threads; while (pool->started > pool->wanted) etp_end_thread (pool);