NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/53998 CVS commit: src/sys



This is not a bug. Nobody is waiting for those processes (they all end up zombies), so eventually you run out.

[10:18pm] 2463>diff -u semaphore.c{,.new}
--- semaphore.c 2019-03-09 22:18:25.682843288 -0500
+++ semaphore.c.new     2019-03-09 22:18:11.078956324 -0500
@@ -5,6 +5,7 @@
 #include <semaphore.h>
 #include <pthread.h>
 #include <string.h>
+#include <sys/wait.h>
 
 #define NUMBER_OF_THREADS      8
 
@@ -22,6 +23,7 @@
 thread(void *arg)
 {
        char                    **arguments;
+       int status;
 
        pid_t                   pid;
        thread_arg_t    *ta = arg;
@@ -75,6 +77,7 @@
                perror("sem_destroy()");
                _exit(EXIT_FAILURE);
        }
+       wait(&status);
 
        ta->active = false;
        pthread_exit(NULL);



Home | Main Index | Thread Index | Old Index