package oxbow

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

Source file schedule.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
let send = ref (fun () -> ())
let requested = ref false
let in_tick = ref false
let install f = send := f

let manage () =
  if not !requested
  then (
    requested := true;
    if not !in_tick then !send ())
;;

let with_tick f =
  assert (not !in_tick);
  requested := false;
  in_tick := true;
  Fun.protect f ~finally:(fun () ->
    in_tick := false;
    if !requested then !send ())
;;