Diffusion Ark b1a251ebb96b

Rework kill logic

Authored by elvisangelaccio on Feb 25 2018, 5:03 PM.

Description

Rework kill logic

The libzip plugin sometimes cannot react to QThread::requestInterruption()
because there is a blocking zip_close() which writes to disk (e.g. with AddJobs).

This means we have to manually abort the thread (by passing a timeout to
QThread::wait() in Job::doKill(). We cannot do this uconditionally
because we would end up with crashes in libarchive. Since the libarchive
plugin is not affected by this problem, we rework the logic in
Job::doKill() by assuming that the interface will tell us whether it
needs to be brutally killed. This way we can distinguish between the
libarchive and the libzip plugins (the ones that use a worker thread).

The mutex in this patch is needed because in theory m_operationMode could be
read and written by different threads at the same time, even though that's unlikely.

BUG: 389290
FIXED-IN: 18.03.80
Task: T7824

Details

Committed
elvisangelaccioFeb 25 2018, 10:41 PM
Parents
R36:0fba00d0186a: libzip: implement killing TestJob
Branches
Unknown
Tags
Unknown