Skip to content

Sys_error("Mutex.unlock: Operation not permitted") on double call to message function #58

@mjambon

Description

@mjambon

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 "");;

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions