sig
  type key
  type ('a, 'b, 'c) t = {
    enter : 'a -> JoinCount.Monitor.key;
    leave : JoinCount.Monitor.key * 'b -> unit;
    is_pending : JoinCount.Monitor.key -> bool;
    get_pendings : unit -> (JoinCount.Monitor.key * 'a) list;
    wait : unit -> 'c;
    finished : unit Join.chan;
  }
  val create : ('a -> 'b -> 'b) -> 'b -> ('c, 'a, 'b) JoinCount.Monitor.t
end