Permalink
Browse files

don't remove resource unless we actually added it

  • Loading branch information...
1 parent 759b1f0 commit 8dbab94cee186f998a17378bc84632b0f639ae1d Jake Donham committed Dec 3, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/lwt-equeue/lwt_equeue.ml
@@ -43,11 +43,12 @@ let select add set_r set_w set_e timeout =
| Some t -> es#remove_resource g t
end;
begin match timeout with
- | None -> old_timeout := None
- | Some ts ->
+ | Some ts when add ->
let r = Unixqueue.Wait (es#new_wait_id ()) in
- if add then es#add_resource g (r, ts);
+ es#add_resource g (r, ts);
old_timeout := Some r
+ | _ ->
+ old_timeout := None
end;
(lazy 0., [], [], [])

0 comments on commit 8dbab94

Please sign in to comment.