An implementation of Mutual exclusion and synchronization.