Version française
Home     About     Download     Resources     Contact us    
Browse thread
AW: [Caml-list] Unix.waitpid
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Bauer, Christoph <Christoph.Bauer@l...>
Subject: AW: [Caml-list] Unix.waitpid
Sorry,

> let wait ?(delay_time = 0.01) pid idle x =
>   let rec wait' () =
>     idle x;
>     delay delay_time;
>     let pid = try fst (Unix.waitpid [Unix.WNOHANG] pid) with 
> _  -> 1 in
>       if pid <> 0 then wait' ()
>   in wait' ()
this code is wrong, my original code was:

let rec wait' () =
      idle x;
      delay delay_time;
     let wpid = try fst( Unix.waitpid [Unix.WNOHANG] pid) with _ -> pid in
       if pid <> wpid then wait' ()
    in wait' ()

Christoph Bauer