mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 07:22:08 -04:00
Make the #define for thread stack size private by moving it to thread.c, rather than thread.h.
This commit is contained in:
parent
63b0714574
commit
677976e442
2 changed files with 6 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue