Skip to content
  • Elvis Angelaccio's avatar
    Fix race condition in LoadJob · 1121db92
    Elvis Angelaccio authored
    Currently `extracttest` has random failures when we check properties
    with the libarchive plugin.
    
    This happens because there is a race condition between
    `LoadJob::onFinished()` (where we read some `LoadJob` members) and
    `LoadJob::onNewEntry()` (where we write those members).
    
    `onFinished()` is called when `list()` returns, in `LoadJob::doWork()`.
    But that might happen before `onNewEntry()` is called, since they are executed
    in two different threads.
    
    This patch puts the `onFinished()` call in the event queue, just like the
    single-thread case does (where we emit the `finished` signal from `CliInterface`).
    
    Differential Revision: D3111
    1121db92