:: Re: [DNG] Doing away with multi-thr…
Top Pagina
Delete this message
Reply to this message
Auteur: tilt!
Datum:  
Aan: dng
Onderwerp: Re: [DNG] Doing away with multi-threading in my project (netman)
Sorry,

come to think about it, simply return if rv is -1,
because that means there are no un-waited children left.

You should definately first fix the pcint Status issue,
because if you give an invalid argument ot waitpid, it
returns -1 and sets errno to EINVAL.

while true
     rv := waitpid(-1, Status, WNOHANG);


     if rv=-1
        if fpGetErrno <> ECHILD the
           report "ERROR: unexpected error: " fpGetErrno
        return;
     else if rv<>0
        report "DEBUG: pid " rv " exited with status " Status
        continue;
end; {* while true *}


Best regards,
T.