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.
This commit is contained in:
Mike Makonnen 2003-06-04 08:16:32 +00:00
parent 3b68228cce
commit f833c84a8f

View File

@ -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);