Sample implementation of several variants of mutual exclusion protocols.