Skip to content

Commit 65c2c85

Browse files
jenshannoschwalmTurboGit
authored andcommitted
Fix calculation and tests for pending jobs
1. The CUPS detection job should be taken into account if not finished yet 2. Always accept at least one DT_JOB_QUEUE_SYSTEM_FG job while testing for a note
1 parent 89b8851 commit 65c2c85

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/control/control.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,12 @@ void dt_control_quit()
309309
g_usleep(1000);
310310
#endif
311311

312-
if(dt_control_jobs_pending())
312+
// We test pending jobs vs 1 as we always accept one DT_JOB_QUEUE_SYSTEM_FG job
313+
if(dt_control_jobs_pending() > 1)
313314
dt_control_log(_("<span foreground='#FF0000' background='#000000'>"
314315
"darktable will be locked until background work has been done"
315316
"</span>"));
316-
for(int i = 0; i < 50 && dt_control_jobs_pending(); i++)
317+
for(int i = 0; i < 50 && (dt_control_jobs_pending() > 1); i++)
317318
{
318319
g_usleep(100000);
319320
dt_gui_process_events();

src/control/jobs.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,6 @@ int dt_control_jobs_pending()
661661
int pending = dt_atomic_get_int(&control->pending_jobs);
662662
if(darktable.backthumbs.running)
663663
pending--;
664-
#ifdef HAVE_PRINT
665-
pending--;
666-
#endif
667664
return pending;
668665
}
669666
// clang-format off

0 commit comments

Comments
 (0)