The recommended method for locking a resource is to create a lock step type in the main sequence before executing the step that accesses the resource.
This community example provides a sequence file that uses this lock step type to lock a resource appropriately and explains how to configure the sequence in detail.