mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-22 15:47:37 +01:00
(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)
This commit is contained in:
parent
23884c98cb
commit
b0406d0a2a
1 changed files with 6 additions and 1 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue