1 (***********************************************************************)
5 (* Jerome Vouillon, projet Cristal, INRIA Rocquencourt *)
6 (* Objective Caml port by John Malecki and Xavier Leroy *)
8 (* Copyright 1996 Institut National de Recherche en Informatique et *)
9 (* en Automatique. All rights reserved. This file is distributed *)
10 (* under the terms of the Q Public License version 1.0. *)
12 (***********************************************************************)
14 (* $Id: trap_barrier.ml 2553 1999-11-17 18:59:06Z xleroy $ *)
16 (************************** Trap barrier *******************************)
21 let current_trap_barrier = ref 0
23 let install_trap_barrier pos =
24 current_trap_barrier := pos
26 let remove_trap_barrier () =
27 current_trap_barrier := 0
29 (* Ensure the trap barrier state is up to date in current checkpoint. *)
30 let update_trap_barrier () =
31 if !current_checkpoint.c_trap_barrier <> !current_trap_barrier then
34 set_trap_barrier !current_trap_barrier;
35 !current_checkpoint.c_trap_barrier <- !current_trap_barrier)
37 (* Execute `funct' with a trap barrier. *)
38 (* --- Used by `finish'. *)
39 let exec_with_trap_barrier trap_barrier funct =
41 install_trap_barrier trap_barrier;
43 remove_trap_barrier ()
46 remove_trap_barrier ();