2
* Copyright (C) 2006-2009 Citrix Systems Inc.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation; version 2.1 only. with the special
7
* exception on linking described in file LICENSE.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU Lesser General Public License for more details.
14
let stdout_m = Mutex.create ()
16
let debug ?(out=stdout) (fmt: ('a , unit, string, unit) format4) =
17
Threadext.Mutex.execute stdout_m
19
Printf.kprintf (fun s -> Printf.fprintf out "%s\n" s; flush stdout) fmt