mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Don't attempt to disable curses or print a summary during an app restart to prevent deadlocks.
This commit is contained in:
parent
251b71ba3f
commit
448f8dde80
12
cgminer.c
12
cgminer.c
@ -3264,14 +3264,14 @@ const
|
||||
#endif
|
||||
char **initial_args;
|
||||
|
||||
static void clean_up(void);
|
||||
static void clean_up(bool restarting);
|
||||
|
||||
void app_restart(void)
|
||||
{
|
||||
applog(LOG_WARNING, "Attempting to restart %s", packagename);
|
||||
|
||||
__kill_work();
|
||||
clean_up();
|
||||
clean_up(true);
|
||||
|
||||
#if defined(unix) || defined(__APPLE__)
|
||||
if (forkpid > 0) {
|
||||
@ -7219,7 +7219,7 @@ void print_summary(void)
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
static void clean_up(void)
|
||||
static void clean_up(bool restarting)
|
||||
{
|
||||
#ifdef HAVE_OPENCL
|
||||
clear_adl(nDevs);
|
||||
@ -7234,18 +7234,22 @@ static void clean_up(void)
|
||||
#ifdef WIN32
|
||||
timeEndPeriod(1);
|
||||
#endif
|
||||
if (!restarting) {
|
||||
/* Attempting to disable curses or print a summary during a
|
||||
* restart can lead to a deadlock. */
|
||||
#ifdef HAVE_CURSES
|
||||
disable_curses();
|
||||
#endif
|
||||
if (!opt_realquiet && successful_connect)
|
||||
print_summary();
|
||||
}
|
||||
|
||||
curl_global_cleanup();
|
||||
}
|
||||
|
||||
void _quit(int status)
|
||||
{
|
||||
clean_up();
|
||||
clean_up(false);
|
||||
|
||||
#if defined(unix) || defined(__APPLE__)
|
||||
if (forkpid > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user