diff options
author | hp.com!davidm <hp.com!davidm> | 2005-05-05 09:23:46 +0000 |
---|---|---|
committer | hp.com!davidm <hp.com!davidm> | 2005-05-05 09:23:46 +0000 |
commit | b0406d0a2a97b290a835ab94c13036119a0db23b (patch) | |
tree | 902b003d43a67f24bed06ac4cb913a149e995c0b /tests/Gtest-concurrent.c | |
parent | 23884c98cbaf154fd1847936e586157ef119a7fe (diff) | |
download | libunwind-b0406d0a2a97b290a835ab94c13036119a0db23b.tar.gz |
(doit): Set stack-size attribute to increase likelihood that we're able
to create NTHREADS threads. With NTHREADS==128 and the stack-size
rlimit set to "unlimited", the test is otherwise likely to fail because
on ia64 it will default to using 32MB of stack per thread.
(Logical change 1.291)
Diffstat (limited to 'tests/Gtest-concurrent.c')
-rw-r--r-- | tests/Gtest-concurrent.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/Gtest-concurrent.c b/tests/Gtest-concurrent.c index 8fe2ef30..8166fc59 100644 --- a/tests/Gtest-concurrent.c +++ b/tests/Gtest-concurrent.c @@ -28,6 +28,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #endif #include <libunwind.h> +#include <limits.h> #include <pthread.h> #include <signal.h> #include <stdio.h> @@ -81,10 +82,14 @@ static void doit (void) { pthread_t th[NTHREADS]; + pthread_attr_t attr; int i; + pthread_attr_init (&attr); + pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN + 64*1024); + for (i = 0; i < NTHREADS; ++i) - if (pthread_create (th + i, NULL, worker, NULL)) + if (pthread_create (th + i, &attr, worker, NULL)) { fprintf (stderr, "FAILURE: Failed to create %u threads " "(after %u threads)\n", |