The following code raises the Sys_error("Mutex.unlock: Operation not permitted") exception as of logs.0.9.0:
Logs_threaded.enable ();;
Logs.set_reporter (Logs_fmt.reporter ());;
Logs.set_level (Some Info);;
Logs.info (fun m -> m ""; m "");;
$ ocamlfind opt -package logs,logs.fmt,logs.threaded -linkpkg -o logs_mutex logs_mutex.ml
$ ./logs_mutex
logs_mutex: [INFO]
logs_mutex: [INFO]
Fatal error: exception Sys_error("Mutex.unlock: Operation not permitted")
A simple workaround is to avoid calling the m function twice and instead call Logs.info twice:
Logs.info (fun m -> m "");;
Logs.info (fun m -> m "");;