Mutual exclusive lock implementation.