From: Jarkko Hietaniemi Date: Wed, 16 May 2001 13:08:33 +0000 (+0000) Subject: Move the stack desire definition to thread.h. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5cbe9849aa1763616f25576b46308a1cbe474252;p=p5sagit%2Fp5-mst-13.2.git Move the stack desire definition to thread.h. p4raw-id: //depot/perl@10122 --- diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs index c3b94eb..b81ee26 100644 --- a/ext/Thread/Thread.xs +++ b/ext/Thread/Thread.xs @@ -279,14 +279,19 @@ newthread (pTHX_ SV *startsv, AV *initargs, char *classname) if (!attr_inited) { attr_inited = 1; err = pthread_attr_init(&attr); +# ifdef THREAD_CREATE_NEEDS_STACK + if (err == 0) + err = pthread_attr_setstacksize(&attr, THREAD_CREATE_NEEDS_STACK); + if (err) + croak("panic: pthread_attr_setstacksize failed"); +#else + croak("panic: can't pthread_attr_setstacksize"); +# endif # ifdef PTHREAD_ATTR_SETDETACHSTATE -#ifdef DGUX - if (err == 0) - err = pthread_attr_setstacksize(&attr, (1024*16)); -#endif if (err == 0) err = PTHREAD_ATTR_SETDETACHSTATE(&attr, attr_joinable); - + if (err) + croak("panic: pthread_attr_setdetachstate failed"); # else croak("panic: can't pthread_attr_setdetachstate"); # endif diff --git a/thread.h b/thread.h index 24e2a8d..99269a1 100644 --- a/thread.h +++ b/thread.h @@ -73,6 +73,10 @@ # endif #endif +#ifdef DGUX +# define THREAD_CREATE_NEEDS_STACK (16*1024) +#endif + #ifdef I_MACH_CTHREADS /* cthreads interface */