Next: , Previous: , Up: posix lock-pid-files   [Index]


4.30.2 Programming interface to lock PID files

The following bindings are exported by the library (vicare posix lock-pid-files).

Function: with-lock-pid-file lock-pathname log thunk

Evaluate thunk while a lock PID file has been created and locked; upon returning from the thunk the lock file is closed and deleted. Return the return value of thunk; if thunk raises an exception the lock file is closed and deleted, then the exception raised again in a non–continuable fashion.

Reentering the evaluation of thunk by returning to continuations multiple time causes undefined behaviour.

lock-pathname must be a non–empty string representing the pathname of the lock file.

log must be a procedure accepting format–like arguments and logging the resulting string:

(log ?template-string ?arg ...)