Modify resource within lock
Replaced sleeping with sync mechanism