sync et tail-recursion
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3261 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
eb924a201f
commit
169d14212b
|
@ -89,11 +89,16 @@ let basic_sync abort_env genev =
|
|||
end;
|
||||
Mutex.unlock masterlock;
|
||||
(* Extract the result *)
|
||||
let num = !performed in
|
||||
let result = bev.(!performed).result() in
|
||||
(* Handle the aborts and return the result *)
|
||||
do_aborts abort_env genev num;
|
||||
result
|
||||
if abort_env = [] then
|
||||
(* Preserve tail recursion *)
|
||||
bev.(!performed).result()
|
||||
else begin
|
||||
let num = !performed in
|
||||
let result = bev.(num).result() in
|
||||
(* Handle the aborts and return the result *)
|
||||
do_aborts abort_env genev num;
|
||||
result
|
||||
end
|
||||
|
||||
(* Apply a random permutation on an array *)
|
||||
|
||||
|
|
|
@ -89,11 +89,16 @@ let basic_sync abort_env genev =
|
|||
end;
|
||||
Mutex.unlock masterlock;
|
||||
(* Extract the result *)
|
||||
let num = !performed in
|
||||
let result = bev.(!performed).result() in
|
||||
(* Handle the aborts and return the result *)
|
||||
do_aborts abort_env genev num;
|
||||
result
|
||||
if abort_env = [] then
|
||||
(* Preserve tail recursion *)
|
||||
bev.(!performed).result()
|
||||
else begin
|
||||
let num = !performed in
|
||||
let result = bev.(num).result() in
|
||||
(* Handle the aborts and return the result *)
|
||||
do_aborts abort_env genev num;
|
||||
result
|
||||
end
|
||||
|
||||
(* Apply a random permutation on an array *)
|
||||
|
||||
|
|
Loading…
Reference in New Issue