Implementing mutex to protect pista and box.