is.locked {flock} | R Documentation |
Checks whether a lock has been obtained.
is.locked(file.lock)
file.lock |
The lock as an object of type |
Ivan Popivanov
## Not run:
require(flock)
file.lock = lock("~/file.lock")
# Critical section code goes between here and the unlock call
if(is.locked(file.lock)) {
print("Got the lock!")
}
unlock(file.lock)
## End(Not run)