Manual fine-grained locking