package luv

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

Source file condition.ml

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
(* This file is part of Luv, released under the MIT license. See LICENSE.md for
   details, or visit https://github.com/aantron/luv/blob/master/LICENSE.md. *)



type t = C.Types.Condition.t Ctypes.ptr

let init () =
  let condition = Ctypes.addr (Ctypes.make C.Types.Condition.t) in
  C.Functions.Condition.init condition
  |> Error.to_result condition

let destroy =
  C.Functions.Condition.destroy

let signal =
  C.Functions.Condition.signal

let broadcast =
  C.Functions.Condition.broadcast

let wait =
  C.Blocking.Condition.wait

let timedwait condition mutex interval =
  C.Blocking.Condition.timedwait
    condition mutex (Unsigned.UInt64.of_int interval)
  |> Error.to_result ()
OCaml

Innovation. Community. Security.