pthread_attr_t attr;
pthread_t threads[NUM_THREAD];
int args[NUM_THREAD];
+ size_t stacksize;
int i = * (int *) arg;
int j;
pthread_attr_init (&attr); /* set breakpoint 1 here. */
- pthread_attr_setstacksize (&attr, 2*PTHREAD_STACK_MIN);
+ pthread_attr_getstacksize (&attr, &stacksize);
+ pthread_attr_setstacksize (&attr, 2 * stacksize);
/* Create a ton of quick-executing threads, then wait for them to
complete. */
pthread_attr_t attr;
pthread_t threads[NUM_CREATE];
int args[NUM_CREATE];
+ size_t stacksize;
int n, i;
pthread_attr_init (&attr);
- pthread_attr_setstacksize (&attr, 2*PTHREAD_STACK_MIN);
+ pthread_attr_getstacksize (&attr, &stacksize);
+ pthread_attr_setstacksize (&attr, 2 * stacksize);
for (n = 0; n < 100; ++n)
{