From 677976e44252ad7c4951e81d1ff664414d0a52ab Mon Sep 17 00:00:00 2001 From: Michael Graff Date: Wed, 19 Apr 2000 20:48:24 +0000 Subject: [PATCH] Make the #define for thread stack size private by moving it to thread.c, rather than thread.h. --- lib/isc/pthreads/include/isc/thread.h | 4 ---- lib/isc/pthreads/thread.c | 9 ++++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/isc/pthreads/include/isc/thread.h b/lib/isc/pthreads/include/isc/thread.h index 1e99c0099f..25bf9e4dbd 100644 --- a/lib/isc/pthreads/include/isc/thread.h +++ b/lib/isc/pthreads/include/isc/thread.h @@ -35,10 +35,6 @@ isc_thread_create(isc_threadfunc_t, isc_threadarg_t, isc_thread_t *); /* XXX We could do fancier error handling... */ -#ifndef ISC_THREAD_MINSTACKSIZE -#define ISC_THREAD_MINSTACKSIZE (64 * 1024) -#endif - #define isc_thread_join(t, rp) \ ((pthread_join((t), (rp)) == 0) ? \ ISC_R_SUCCESS : ISC_R_UNEXPECTED) diff --git a/lib/isc/pthreads/thread.c b/lib/isc/pthreads/thread.c index 65d44e99fc..23bfc8f1ed 100644 --- a/lib/isc/pthreads/thread.c +++ b/lib/isc/pthreads/thread.c @@ -23,6 +23,10 @@ #include #include +#ifndef THREAD_MINSTACKSIZE +#define THREAD_MINSTACKSIZE (64 * 1024) +#endif + isc_result_t isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg, isc_thread_t *thread) @@ -37,9 +41,8 @@ isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg, if (ret != 0) return (ISC_R_UNEXPECTED); - if (stacksize < ISC_THREAD_MINSTACKSIZE) { - ret = pthread_attr_setstacksize(&attr, - ISC_THREAD_MINSTACKSIZE); + if (stacksize < THREAD_MINSTACKSIZE) { + ret = pthread_attr_setstacksize(&attr, THREAD_MINSTACKSIZE); if (ret != 0) return (ISC_R_UNEXPECTED); }