mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 19:55:31 -05:00
reindent in containers.thread
This commit is contained in:
parent
59208fd9c6
commit
9a46b4527c
5 changed files with 228 additions and 228 deletions
|
|
@ -91,7 +91,7 @@ let update l f =
|
||||||
|
|
||||||
(*$T
|
(*$T
|
||||||
let l = create 5 in update l (fun x->x+1); get l = 6
|
let l = create 5 in update l (fun x->x+1); get l = 6
|
||||||
*)
|
*)
|
||||||
|
|
||||||
let update_map l f =
|
let update_map l f =
|
||||||
with_lock l
|
with_lock l
|
||||||
|
|
@ -102,7 +102,7 @@ let update_map l f =
|
||||||
|
|
||||||
(*$T
|
(*$T
|
||||||
let l = create 5 in update_map l (fun x->x+1, string_of_int x) = "5" && get l = 6
|
let l = create 5 in update_map l (fun x->x+1, string_of_int x) = "5" && get l = 6
|
||||||
*)
|
*)
|
||||||
|
|
||||||
let get l =
|
let get l =
|
||||||
Mutex.lock l.mutex;
|
Mutex.lock l.mutex;
|
||||||
|
|
@ -135,7 +135,7 @@ let decr l = update l Pervasives.pred
|
||||||
(*$T
|
(*$T
|
||||||
let l = create 0 in incr l ; get l = 1
|
let l = create 0 in incr l ; get l = 1
|
||||||
let l = create 0 in decr l ; get l = ~-1
|
let l = create 0 in decr l ; get l = ~-1
|
||||||
*)
|
*)
|
||||||
|
|
||||||
let incr_then_get l =
|
let incr_then_get l =
|
||||||
Mutex.lock l.mutex;
|
Mutex.lock l.mutex;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ type job =
|
||||||
module TaskHeap = CCHeap.Make(struct
|
module TaskHeap = CCHeap.Make(struct
|
||||||
type t = job
|
type t = job
|
||||||
let leq (Job(f1,_)) (Job (f2,_)) = f1 <= f2
|
let leq (Job(f1,_)) (Job (f2,_)) = f1 <= f2
|
||||||
end)
|
end)
|
||||||
|
|
||||||
exception Stopped
|
exception Stopped
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue