On Sat, Apr 18, 2009 at 06:20, Rémi Forax <fo...@univ-mlv.fr> wrote: > The other solution is to provide a way in the API to test if shutdown hooks > have been started or not.
> In that case, all application codes that start a shutdown hook like > Console.readPassword() > can check if shudown hooks run or not and throw a runtime exception > if shutdown hook run. It seems to me there is an inherent race condition with such a check-then-act sequence, unless there is a mechanism for the application to hold some kind of shutdown hook lock. Martin