Wrap a callback for waiting for the lock, if isAsync is true. Otherwise this is a pass-though. Only wrap the code that needs the lock in this, to allow others to use the lock.
If the lock should be enabled.
The lock. Only should be provided if isAsync is true
The callback to call once the lock is acquired, or immediately if isAsync is false.
The result of the callback.
Wrap a callback for waiting for the lock, if isAsync is true. Otherwise this is a pass-though. Only wrap the code that needs the lock in this, to allow others to use the lock.