Package uk.ac.manchester.spinnaker.utils
Class ThreadUtils
java.lang.Object
uk.ac.manchester.spinnaker.utils.ThreadUtils
Utilities for working with threads.
-
Method Details
-
threadDump
Produce a dump of what all threads are doing. Useful for debugging as it means you can get a dump of threads programmatically at the time when the problem is likely to be on some thread's stack.- Returns:
- The dump, as a multi-line string.
-
sleep
public static void sleep(long delay) Recommended way of doing "quiet" sleeps.- Parameters:
delay
- How long to sleep for, in milliseconds.- See Also:
-
waitfor
Wait for the given object.- Parameters:
obj
- The object to wait for- Returns:
- True if the wait was interrupted, false otherwise
-
waitfor
Wait for the given object.- Parameters:
obj
- The object to wait fortimeout
- The maximum time to wait, in milliseconds- Returns:
- True if the wait was interrupted, false otherwise
-