Use the forcelog function on shutdown to cope with indeterminate console lock states due to killing of threads.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
diff --git a/cgminer.c b/cgminer.c
index 26482f1..336377c 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -3159,7 +3159,7 @@ static void kill_mining(void)
struct thr_info *thr;
int i;
- applog(LOG_DEBUG, "Killing off mining threads");
+ forcelog(LOG_DEBUG, "Killing off mining threads");
/* Kill the mining threads*/
for (i = 0; i < mining_threads; i++) {
pthread_t *pth = NULL;
@@ -3186,29 +3186,29 @@ static void __kill_work(void)
if (!successful_connect)
return;
- applog(LOG_INFO, "Received kill message");
+ forcelog(LOG_INFO, "Received kill message");
#ifdef USE_USBUTILS
/* Best to get rid of it first so it doesn't
* try to create any new devices */
if (!opt_scrypt) {
- applog(LOG_DEBUG, "Killing off HotPlug thread");
+ forcelog(LOG_DEBUG, "Killing off HotPlug thread");
thr = &control_thr[hotplug_thr_id];
kill_timeout(thr);
}
#endif
- applog(LOG_DEBUG, "Killing off watchpool thread");
+ forcelog(LOG_DEBUG, "Killing off watchpool thread");
/* Kill the watchpool thread */
thr = &control_thr[watchpool_thr_id];
kill_timeout(thr);
- applog(LOG_DEBUG, "Killing off watchdog thread");
+ forcelog(LOG_DEBUG, "Killing off watchdog thread");
/* Kill the watchdog thread */
thr = &control_thr[watchdog_thr_id];
kill_timeout(thr);
- applog(LOG_DEBUG, "Shutting down mining threads");
+ forcelog(LOG_DEBUG, "Shutting down mining threads");
for (i = 0; i < mining_threads; i++) {
struct cgpu_info *cgpu;
@@ -3226,12 +3226,12 @@ static void __kill_work(void)
cg_completion_timeout(&kill_mining, NULL, 3000);
- applog(LOG_DEBUG, "Killing off stage thread");
+ forcelog(LOG_DEBUG, "Killing off stage thread");
/* Stop the others */
thr = &control_thr[stage_thr_id];
kill_timeout(thr);
- applog(LOG_DEBUG, "Killing off API thread");
+ forcelog(LOG_DEBUG, "Killing off API thread");
thr = &control_thr[api_thr_id];
kill_timeout(thr);
@@ -3239,10 +3239,10 @@ static void __kill_work(void)
/* Release USB resources in case it's a restart
* and not a QUIT */
if (!opt_scrypt) {
- applog(LOG_DEBUG, "Releasing all USB devices");
+ forcelog(LOG_DEBUG, "Releasing all USB devices");
cg_completion_timeout(&usb_cleanup, NULL, 1000);
- applog(LOG_DEBUG, "Killing off usbres thread");
+ forcelog(LOG_DEBUG, "Killing off usbres thread");
thr = &control_thr[usbres_thr_id];
kill_timeout(thr);
}