Permalink
Browse files

some places we don't need to cancel

  • Loading branch information...
1 parent 70ebf62 commit 306dad992ffe253369d4c48f9841b8640f23b149 Jake Donham committed May 1, 2010
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/froc/froc.ml
View
@@ -170,10 +170,9 @@ let join_e ee =
if is_never ee then never
else
let rt, ru = make_event () in
- let c = ref no_cancel in
notify_result_e ee begin function
- | Value e -> cancel !c; c := notify_result_e_cancel e (write_temp_result ru)
- | Fail e -> cancel !c; c := no_cancel; write_temp_result ru (Fail e)
+ | Value e -> notify_result_e e (write_temp_result ru)
+ | Fail e -> write_temp_result ru (Fail e)
end;
rt
@@ -194,10 +193,10 @@ let join_b ?eq bb = bind ?eq bb (fun b -> b)
let switch ?eq b e =
if is_never e then b else
let bt, bu = make_changeable ?eq () in
- let c = ref (connect_cancel bu b) in
- notify_result_e e begin function
- | Value b -> cancel !c; c := connect_cancel bu b
- | Fail e -> cancel !c; c := no_cancel; write_exn bu e
+ notify_result e begin function
+ | Fail Unset -> connect bu b
+ | Value b -> connect bu b
+ | Fail e -> write_exn bu e
end;
bt

0 comments on commit 306dad9

Please sign in to comment.