try {
while(!(_lockfile.createNewFile())) {
Thread.sleep(5);
}
} catch (InterruptedException e) {
throw new NSForwardException(e, "Error while locking " + _lockfile);
} catch (IOException e) {
throw new NSForwardException(e, "Error while locking " + _lockfile);
}
_lockfile.deleteOnExit();
_lockcnt++;
_owner = Thread.currentThread();
}