Clean up debug reporting code.

This commit is contained in:
Tony Garnock-Jones 2012-01-08 14:03:09 -05:00
parent 965a9752e0
commit b9eda344cc
2 changed files with 9 additions and 5 deletions

View File

@ -10,13 +10,15 @@ type t = {
let classname = "queue"
let rec do_burst info n =
(*
Printf.printf "INFO: do_burst %d backlog %d waiters %d ticks left\n%!"
let report info n =
Printf.printf "INFO: do_burst %d capacity, %d backlog, %d waiters, %d ticks left\n%!"
(Squeue.approx_capacity info.ch)
(Fqueue.length info.backlog)
(Fqueue.length info.waiters)
n;
*)
n
let rec do_burst info n =
(* report info n; *)
if Fqueue.is_empty info.backlog then false
else
if Fqueue.is_empty info.waiters then false

View File

@ -16,6 +16,8 @@ let create n = {
queue = Queue.create ()
}
let approx_capacity q = q.capacity
let add v q =
Mutex.lock q.mtx;
while q.capacity < 1 do