mutex implementation using peterson's algorithm.