/usr/lib/ocaml/lwt/lwt_main.mli is in liblwt-ocaml-dev 2.7.1-4build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | (* Lightweight thread library for OCaml
* http://www.ocsigen.org/lwt
* Interface Lwt_main
* Copyright (C) 2009-2011 Jérémie Dimino
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, with linking exceptions;
* either version 2.1 of the License, or (at your option) any later
* version. See COPYING file for details.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*)
(** Main loop and event queue *)
(** This module controls the ``main-loop'' of Lwt. *)
val run : 'a Lwt.t -> 'a
(** [run t] calls the Lwt scheduler repeatedly until [t] terminates,
then returns the value returned by the thread. If [t] fails with
an exception, this exception is raised.
Note that you should avoid using [run] inside threads
- The calling threads will not resume before [run]
returns.
- Successive invocations of [run] are serialized: an
invocation of [run] will not terminate before all
subsequent invocations are terminated.
Note also that it is not safe to call [run] in a function
registered with [Pervasives.at_exit], use the {!at_exit}
function of this module instead. *)
val yield : unit -> unit Lwt.t
(** [yield ()] is a threads which suspends itself and then resumes
as soon as possible and terminates. *)
val enter_iter_hooks : (unit -> unit) Lwt_sequence.t
(** Functions that are called before the main iteration. *)
val leave_iter_hooks : (unit -> unit) Lwt_sequence.t
(** Functions that are called after the main iteration. *)
val exit_hooks : (unit -> unit Lwt.t) Lwt_sequence.t
(** Sets of functions executed just before the program exit.
Notes:
- each hook is called exactly one time
- exceptions raised by hooks are ignored *)
val at_exit : (unit -> unit Lwt.t) -> unit
(** [at_exit hook] adds hook at the left of [exit_hooks]*)
|