net.anotheria.util.ThreadUtils Maven / Gradle / Ivy
package net.anotheria.util;
/**
* ThreadUtils class.
*
* @author another
* @version $Id: $Id
*/
public class ThreadUtils {
/**
* waitIgnoreException.
*
* @param monitor a {@link java.lang.Object} object.
*/
public static void waitIgnoreException(Object monitor){
waitIgnoreException(monitor, 0);
}
/**
* waitIgnoreException.
*
* @param monitor a {@link java.lang.Object} object.
* @param timeout a long.
*/
public static void waitIgnoreException(Object monitor, long timeout){
try {
monitor.wait(timeout);
} catch (InterruptedException ignored) {}
}
/**
* sleepIgnoreException.
*
* @param sleepTime a long.
*/
public static void sleepIgnoreException(long sleepTime){
try {
Thread.sleep(sleepTime);
} catch (InterruptedException ignored) {}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy