package devkit

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file lwt_flag.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

module C = Lwt_condition

type 'a t = { cond : 'a C.t; mutable waiter : 'a Lwt.t }

let create () =
  let cond = C.create () in
  { cond; waiter = C.wait cond }

let signal { cond; _ } x = C.signal cond x

let wait fl =
  let%lwt r = fl.waiter in
  fl.waiter <- C.wait fl.cond;
  Lwt.return r
OCaml

Innovation. Community. Security.