javax.jmdns.impl
Class DNSStatefulObject.DNSStatefulObjectSemaphore
java.lang.Object
javax.jmdns.impl.DNSStatefulObject.DNSStatefulObjectSemaphore
- Enclosing interface:
- DNSStatefulObject
public static final class DNSStatefulObject.DNSStatefulObjectSemaphore
- extends Object
This class define a semaphore. On this multiple threads can wait the arrival of one event. Thread wait for a maximum defined by the timeout.
Implementation note: this class is based on Semaphore
so that they can be released by the timeout timer.
- Author:
- Pierre Frisch
Method Summary |
void |
signalEvent()
Signals the semaphore when the event arrives. |
String |
toString()
|
void |
waitForEvent(long timeout)
Blocks the current thread until the event arrives or the timeout expires. |
DNSStatefulObject.DNSStatefulObjectSemaphore
public DNSStatefulObject.DNSStatefulObjectSemaphore(String name)
- Parameters:
name
- Semaphore name for debugging purposes.
waitForEvent
public void waitForEvent(long timeout)
- Blocks the current thread until the event arrives or the timeout expires.
- Parameters:
timeout
- wait period for the event
signalEvent
public void signalEvent()
- Signals the semaphore when the event arrives.
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2002-2011 JmDNS. All Rights Reserved.