ox-it/wl-kernel — pull request #55 by buckett (2014-10-15 11:17:56+00:00)
Title: WL-3014 Prevent shutdown deadlock.

When shutting down, we would change the status and interrupt the thread but before the other thread could process the interrupt we would also mark the maintenance thread to stop and interrupt it again. Then when the interrupt was processed we would jump out of sleep, see we were asked to change status, update the DB and then go back to sleep for the remainder of the sleep period.

The fix means we re-throw the error when we-re in shutdown which breaks us out of the fixed sleep loop.