Package org.cip4.jdflib.util
Class ThreadUtil
- java.lang.Object
-
- org.cip4.jdflib.util.ThreadUtil
-
public class ThreadUtil extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classThreadUtil.MyMutexDeprecated.use org.cip4.jdflib.util.thread.MyMutexstatic classThreadUtil.WaitTimeout<a>Deprecated.use the local class
-
Constructor Summary
Constructors Constructor Description ThreadUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanjoin(java.lang.Thread thread, int millis)simple join wrapper that catches its exceptionstatic voidnotify(java.lang.Object mutex)simple notify that catches any and all exceptionsstatic voidnotifyAll(java.lang.Object mutex)simple notify that catches any and all exceptionsstatic booleansleep(int millis)simple sleep wrapper that catches its exceptionstatic booleanwait(java.lang.Object mutex, int millis)simple wait wrapper that synchronizes catches its exception
-
-
-
Method Detail
-
sleep
public static boolean sleep(int millis)
simple sleep wrapper that catches its exception- Parameters:
millis-- Returns:
- true if normal exit, false if interupted
-
join
public static boolean join(java.lang.Thread thread, int millis)simple join wrapper that catches its exception- Parameters:
thread- the thread to joinmillis-- Returns:
- true if normal exit, false if interupted
-
wait
public static boolean wait(java.lang.Object mutex, int millis)simple wait wrapper that synchronizes catches its exception- Parameters:
mutex- the object that will wait, if null we assume we need not waitmillis- milliseconds to wait, 0 or lower: indefinite wait- Returns:
- true if normal exit, false if interupted or mutex is null
-
notifyAll
public static void notifyAll(java.lang.Object mutex)
simple notify that catches any and all exceptions- Parameters:
mutex- the mutex to notify
-
notify
public static void notify(java.lang.Object mutex)
simple notify that catches any and all exceptions- Parameters:
mutex- the mutex to notify
-
-