On Wed, Jun 29, 2022 at 10:15:29AM -0400, Emanuele Giuseppe Esposito wrote: > Add missing job synchronization in the unit tests, with > explicit locks. > > We are deliberately using _locked functions wrapped by a guard > instead of a normal call because the normal call will be removed > in future, as the only usage is limited to the tests. > > In other words, if a function like job_pause() is/will be only used > in tests to avoid: > > WITH_JOB_LOCK_GUARD(){ > job_pause_locked(); > } > > then it is not worth keeping job_pause(), and just use the guard. > > Note: at this stage, job_{lock/unlock} and job lock guard macros > are *nop*. > > Signed-off-by: Emanuele Giuseppe Esposito > --- > tests/unit/test-bdrv-drain.c | 76 +++++++++++++++++--------- > tests/unit/test-block-iothread.c | 8 ++- > tests/unit/test-blockjob-txn.c | 24 +++++--- > tests/unit/test-blockjob.c | 94 ++++++++++++++++++++++++-------- > 4 files changed, 141 insertions(+), 61 deletions(-) Reviewed-by: Stefan Hajnoczi