diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/solvers/h48/solve.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index bf34a2b..348c122 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h | |||
| @@ -417,8 +417,8 @@ solve_h48( | |||
| 417 | ) | 417 | ) |
| 418 | { | 418 | { |
| 419 | int i, ntasks, eoesep_table_index; | 419 | int i, ntasks, eoesep_table_index; |
| 420 | bool td, fp; | 420 | bool td; |
| 421 | _Atomic int status; | 421 | _Atomic int status, prev_status; |
| 422 | size_t lastused; | 422 | size_t lastused; |
| 423 | int8_t d; | 423 | int8_t d; |
| 424 | dfsarg_solve_h48_t arg[THREADS]; | 424 | dfsarg_solve_h48_t arg[THREADS]; |
| @@ -556,7 +556,6 @@ solve_h48( | |||
| 556 | /* Log solutions and handle pause / stop / resume */ | 556 | /* Log solutions and handle pause / stop / resume */ |
| 557 | if (poll_status != NULL && d >= 15 && NISSY_CANSLEEP) { | 557 | if (poll_status != NULL && d >= 15 && NISSY_CANSLEEP) { |
| 558 | td = false; | 558 | td = false; |
| 559 | fp = true; | ||
| 560 | while (!td && status != NISSY_STATUS_STOP) { | 559 | while (!td && status != NISSY_STATUS_STOP) { |
| 561 | msleep(BASE_SLEEP_TIME); | 560 | msleep(BASE_SLEEP_TIME); |
| 562 | 561 | ||
| @@ -565,13 +564,14 @@ solve_h48( | |||
| 565 | lastused = sollist.used; | 564 | lastused = sollist.used; |
| 566 | pthread_mutex_unlock(&solutions_mutex); | 565 | pthread_mutex_unlock(&solutions_mutex); |
| 567 | 566 | ||
| 567 | prev_status = status; | ||
| 568 | status = poll_status(poll_status_data); | 568 | status = poll_status(poll_status_data); |
| 569 | if (status == NISSY_STATUS_PAUSE && fp) { | 569 | if (status != prev_status) { |
| 570 | LOG("[H48 solve] Paused\n"); | 570 | if (status == NISSY_STATUS_PAUSE) |
| 571 | fp = false; | 571 | LOG("[H48 solve] Paused\n"); |
| 572 | if (status == NISSY_STATUS_RUN) | ||
| 573 | LOG("[H48 solve] Resumed\n"); | ||
| 572 | } | 574 | } |
| 573 | if (status == NISSY_STATUS_RUN) | ||
| 574 | fp = true; | ||
| 575 | 575 | ||
| 576 | for (td = true, i = 0; i < threads; i++) | 576 | for (td = true, i = 0; i < threads; i++) |
| 577 | td = td && arg[i].thread_done; | 577 | td = td && arg[i].thread_done; |
