Module Control
Global control of Coq.
val interrupt : bool Stdlib.ref
Coq interruption: set the following boolean reference to interrupt Coq (it eventually raises
Break
, simulating a Ctrl-C)
val check_for_interrupt : unit -> unit
Use this function as a potential yield function. If
interrupt
has been set, il will raiseSys.Break
.
val timeout : int -> ('a -> 'b) -> 'a -> exn -> 'b
timeout n f x e
tries to computef x
, and if it fails to do so beforen
seconds, it raisese
instead.
type timeout
=
{
timeout : a b. int -> ('a -> 'b) -> 'a -> exn -> 'b;
}
Set a particular timeout function; warning, this is an internal API and it is scheduled to go away.
val set_timeout : timeout -> unit
val protect_sigalrm : ('a -> 'b) -> 'a -> 'b
protect_sigalrm f x
computesf x
, but if SIGALRM is received during that computation, the signal handler is executed only once the computation is terminated. Otherwise said, it makes the execution off
atomic w.r.t. handling of SIGALRM.This is useful for example to prevent the implementation of `Timeout` to interrupt I/O routines, generating ill-formed output.