From f833c84a8f5b42ac1c4dca08b79644e077d219c8 Mon Sep 17 00:00:00 2001 From: Mike Makonnen Date: Wed, 4 Jun 2003 08:16:32 +0000 Subject: [PATCH] If the library is not able to create a thread because resources don't allow it at the moment, the correct thing to do is try again. Otherwise, libthr would fail this test because it doesn't allow an unlimited number of concurrent threads per application. --- lib/libc_r/test/join_leak_d.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libc_r/test/join_leak_d.c b/lib/libc_r/test/join_leak_d.c index 6532ca5bfc7..9a351400e31 100644 --- a/lib/libc_r/test/join_leak_d.c +++ b/lib/libc_r/test/join_leak_d.c @@ -65,6 +65,10 @@ main(void) for (i = 0; i < NITERATIONS; i++) { if ((error = pthread_create(&thread, NULL, thread_entry, NULL)) != 0) { + if (error == EAGAIN) { + i--; + continue; + } fprintf(stderr, "Error in pthread_create(): %s\n", strerror(error)); exit(1);