:: Re: [DNG] Doing away with multi-thr…
トップ ページ
このメッセージを削除
このメッセージに返信
著者: tilt!
日付:  
To: dng
題目: 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.