Implementation of Chandy-Lamport algorithm on a single Erlang machine