Fix: In order to ensure the "correct" ordering, *all* threads need to wait for the...
commit193488e26f641984fd1baf0171a4249855b9b7a6
authorlordmulder <mulder2@gmx.de>
Sat, 12 May 2012 00:51:24 +0000 (12 02:51 +0200)
committerlordmulder <mulder2@gmx.de>
Sat, 12 May 2012 00:51:24 +0000 (12 02:51 +0200)
tree090ae606e237713518e31f8b489403e471063e90
parent68d2a28c7b1a0215f645a18c4149a7347390e470
Fix: In order to ensure the "correct" ordering, *all* threads need to wait for the previous threads to finish - not only the threads that will emit a file. If both, thread n and n+1, want to emit a file and thus n+1 has to wait for n, we additionally must allow thread n+2 to terminate before n and n+1, even if n+2 does *not* emit a file. That's because as soon as n+2 finishes, it unblocks all threads x with x < n+2, which includes n and n+1. If that happens and n+1 is still waiting for n, we effectively allow n+1 to emit its file *before* n. By blocking all threads x with x > n+1 until n+1 has finished (regardless of whether they want to emit a file or not) this problem is resolved. As long as we assume that most threads actually *do* emit a file, this commit shouldn't hurt the performance.
src/Dialog_WorkingBanner.cpp
src/Dialog_WorkingBanner.h
src/Thread_FileAnalyzer.cpp
src/Thread_FileAnalyzer_Task.cpp
src/Thread_FileAnalyzer_Task.h