Implemented simple writelocking