@NotThreadSafe public class FileBasedOneShotLatch extends Object implements Closeable
Constructor and Description |
---|
FileBasedOneShotLatch(Path latchFile) |
Modifier and Type | Method and Description |
---|---|
void |
await()
Waits until the latch file is created.
|
void |
close() |
public FileBasedOneShotLatch(Path latchFile)
public void await() throws InterruptedException
When this method returns, subsequent invocations will not block even after the latch file is deleted. Note that this method may not return if the latch file is deleted before this method returns.
InterruptedException
- if interrupted while waitingpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.