Commit 677976e4 authored by Michael Graff's avatar Michael Graff

Make the #define for thread stack size private by moving it to thread.c, rather than thread.h.

parent 63b07145
......@@ -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)
......
......@@ -23,6 +23,10 @@
#include <isc/thread.h>
#include <isc/error.h>
#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);
}
......
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