let suspend_resource r cmd kont prods =
let cache_entry = get r in
match cache_entry.built with
| Bsuspension _ -> ()
| Bbuilt -> ()
| Bcannot_be_built -> assert false
| Bnot_built_yet ->
let kont = begin fun () ->
kont ();
List.iter begin fun prod ->
(get prod).built <- Bbuilt
end prods
end in cache_entry.built <- Bsuspension(cmd, kont)