Implement resource locking
Apply code review
Apply CR
Merge pull request #103 from ogail/resource

Implement resource locking