Java: How to timeout the current thread
I have a multithreaded Java application that makes uses ThreadLocal fields to keep the threads isolated from each other. As part of this application I also have a requirement to implement timeouts on certain functions to prevent DOS attacks.