Skip to content
  • Andrew Savonichev's avatar
    BUG:360677 KisUpdaterContext should not kill threads in waitForDone() · 9c34fef3
    Andrew Savonichev authored and Dmitry Kazakov's avatar Dmitry Kazakov committed
    Summary:
    KisUpdaterContext::waitForDone() method must lock context and wait
    untill all threads finish their current tasks.
    We cannot call QThreadPool.waitForDone() to do this, because after
    waiting it removes all threads from the pool.
    
    Test Plan:
    Verified that no extra threads created: 8 for global thread pool and 8 for
    KisUpdaterContext
    
    (gdb) info threads
      Id   Target Id         Frame
      22   Thread 0x7fff8cff9700 (LWP 18481) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0
      21   Thread 0x7fff8d7fa700 (LWP 18480) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0
      20   Thread 0x7fff8dffb700 (LWP 18479) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0
      19   Thread 0x7fff8e7fc700 (LWP 18478) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0
      18   Thread 0x7f...
    9c34fef3