From: Jérémie D. <Ba...@us...> - 2010-05-09 17:48:23
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "krobot". The branch, master has been updated via bc4bb4d72adf50b771323b7d2ce8d32908d41a76 (commit) from ba76d82676dc69f2b4d19d4ebb879c01cf839090 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit bc4bb4d72adf50b771323b7d2ce8d32908d41a76 Author: Jérémie Dimino <je...@di...> Date: Sun May 9 19:47:56 2010 +0200 fix a race condition in the controller ----------------------------------------------------------------------- Changes: diff --git a/info/control/clients/controller.ml b/info/control/clients/controller.ml index 13a7d93..5e7d435 100644 --- a/info/control/clients/controller.ml +++ b/info/control/clients/controller.ml @@ -509,28 +509,32 @@ lwt () = with exn -> Lwt_log.error_f ~exn "cannot monitor property" in - Lwt_signal.always_notify_s - (function - | true -> - join [ - notify_property (Krobot.Compass.measure krobot); - notify_property (Krobot.Logic_sensors.states krobot); - notify_property (Krobot.Range_finders.measures krobot); - notify_property (Krobot.Motors.inhibit_forward_until krobot); - notify_property (Krobot.Motors.inhibit_backward_until krobot); - notify_property (Krobot.Card.state krobot `Interface); - notify_property (Krobot.Card.state krobot `Sensor); - notify_property (Krobot.Card.state krobot `Motor); - notify_property (Krobot.Card.state krobot `Monitoring); - notify_property (Krobot.devices_status krobot); - notify_property (Krobot.Infrared.states krobot); - notify_property (Krobot.Power.current krobot); - ] - | false -> - List.iter Lwt_signal.disable !notifiers; - notifiers := []; - return ()) - (React.S.map (fun services -> List.mem "Driver" services) services); + ignore ( + lwt () = Lwt_unix.yield () in + Lwt_signal.always_notify_s + (function + | true -> + join [ + notify_property (Krobot.Compass.measure krobot); + notify_property (Krobot.Logic_sensors.states krobot); + notify_property (Krobot.Range_finders.measures krobot); + notify_property (Krobot.Motors.inhibit_forward_until krobot); + notify_property (Krobot.Motors.inhibit_backward_until krobot); + notify_property (Krobot.Card.state krobot `Interface); + notify_property (Krobot.Card.state krobot `Sensor); + notify_property (Krobot.Card.state krobot `Motor); + notify_property (Krobot.Card.state krobot `Monitoring); + notify_property (Krobot.devices_status krobot); + notify_property (Krobot.Infrared.states krobot); + notify_property (Krobot.Power.current krobot); + ] + | false -> + List.iter Lwt_signal.disable !notifiers; + notifiers := []; + return ()) + (React.S.map (fun services -> List.mem "Driver" services) services); + return () + ); List.iter (fun card -> hooks/post-receive -- krobot |