Make __kill_work itself also be a completion timeout.
diff --git a/cgminer.c b/cgminer.c
index c2d56e7..0df05b4 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -3560,7 +3560,7 @@ static void __kill_work(void)
/* This should be the common exit path */
void kill_work(void)
{
- __kill_work();
+ cg_completion_timeout(&__kill_work, NULL, 5000);
quit(0, "Shutdown signal received.");
}