BUG:360677 KisUpdaterContext should not kill threads in waitForDone()
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 0x7fff8effd700 (LWP 18477) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 17 Thread 0x7fff8f7fe700 (LWP 18476) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 16 Thread 0x7fff8ffff700 (LWP 18475) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 15 Thread 0x7fff9bfff700 (LWP 18474) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 13 Thread 0x7fffb8ff9700 (LWP 18471) "QFileInfoGather" 0x00007fffef6e291f in pthread_cond_wait () from /lib64/libpthread.so.0 12 Thread 0x7fffb97fa700 (LWP 18470) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 11 Thread 0x7fffb9ffb700 (LWP 18469) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 10 Thread 0x7fffba7fc700 (LWP 18468) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 9 Thread 0x7fffbaffd700 (LWP 18467) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 8 Thread 0x7fffbb7fe700 (LWP 18466) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 7 Thread 0x7fffbbfff700 (LWP 18465) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 6 Thread 0x7fffc8f8a700 (LWP 18464) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 5 Thread 0x7fffc978b700 (LWP 18463) "Thread (pooled)" 0x00007fffef6e2cc8 in pthread_cond_timedwait () from /lib64/libpthread.so.0 4 Thread 0x7fffca38d700 (LWP 18462) "KisTileDataSwap" 0x00007fffef6e291f in pthread_cond_wait () from /lib64/libpthread.so.0 3 Thread 0x7fffcab8e700 (LWP 18461) "KisTileDataPool" 0x00007fffef6e291f in pthread_cond_wait () from /lib64/libpthread.so.0 2 Thread 0x7fffe0843700 (LWP 18460) "QXcbEventReader" 0x00007ffff16a33ed in poll () from /lib64/libc.so.6 * 1 Thread 0x7fffe7f3f7c0 (LWP 18456) "krita" 0x00007ffff16a33ed in poll () from /lib64/libc.so.6 Reviewers: dkazakov Reviewed By: dkazakov Subscribers: fazek BUG:360677 Differential Revision: https://phabricator.kde.org/D1166
Showing
- libs/image/kis_update_scheduler.cpp 10 additions, 2 deletionslibs/image/kis_update_scheduler.cpp
- libs/image/kis_updater_context.cpp 89 additions, 14 deletionslibs/image/kis_updater_context.cpp
- libs/image/kis_updater_context.h 14 additions, 0 deletionslibs/image/kis_updater_context.h
- libs/image/tests/kis_strokes_queue_test.cpp 14 additions, 0 deletionslibs/image/tests/kis_strokes_queue_test.cpp
- libs/image/tests/kis_updater_context_test.cpp 2 additions, 0 deletionslibs/image/tests/kis_updater_context_test.cpp
Loading