Function
critical (mutex-list, f) a -> value
Evaluates a function call between a wait and a signal, with appropriate behavior on exceptions.
This function first waits for the mutexes in mutex-list. Then it applies f to a. Then it signals that the mutexes in mutex-list are free. Finally, it returns the result of the application of f to a.
The mutex-list is of type mutex list; f is a function (type 'a -> 'b) and a must be a valid argument to f.