Implement resource locking