Pass task_test also with threads disabled

Condition cv is declared only when threads are used. Use it only in that
case. Test compiles and passes without thread support also.
83 jobs for !4442 with nothread-tast_test in 15 minutes and 13 seconds (queued for 8 seconds)
detached
Status Job ID Name Coverage
  Precheck
passed #1334963
amd64 linux
autoreconf

00:00:16

passed #1334965
amd64 linux
clang-format

00:00:09

passed #1334966
amd64 linux
coccinelle

00:01:04

passed #1334967
amd64 linux
danger

00:00:14

passed #1334964
amd64 linux
misc

00:00:15

 
  Build
passed #1334982
amd64 linux
clang:asan

00:04:23

passed #1334987
amd64 linux
clang:buster:amd64

00:02:01

passed #1334989
amd64 libvirt
clang:freebsd11:amd64

00:02:00

passed #1334990
amd64 libvirt
clang:freebsd12:amd64

00:02:06

passed #1334991
amd64 libvirt
clang:openbsd:amd64

00:03:52

passed #1334984
amd64 linux
clang:tsan

00:02:43

passed #1334968
amd64 linux
gcc:alpine3.12:amd64

00:01:46

passed #1334981
amd64 linux
gcc:asan

00:03:41

passed #1334974
amd64 linux
gcc:buster:amd64

00:01:22

passed #1334970
amd64 linux
gcc:centos6:amd64

00:01:30

passed #1334969
i386 linux
gcc:centos6:i386

00:01:35

passed #1334971
amd64 linux
gcc:centos7:amd64

00:01:41

passed #1334972
amd64 linux
gcc:centos8:amd64

00:01:37

passed #1334978
amd64 linux
gcc:fedora33:amd64

00:01:55

passed #1334980
amd64 linux
gcc:focal:amd64

00:02:06

passed #1334985
amd64 linux
gcc:mutexatomics

00:01:38

passed #1334986
amd64 linux
gcc:noatomics

00:02:02

passed #1334976
amd64 linux
gcc:out-of-tree

00:01:57

passed #1334988
amd64 linux
gcc:pkcs11

00:01:45

passed #1334975
amd64 linux
gcc:sid:amd64

00:03:23

passed #1334973
amd64 linux
gcc:stretch:amd64

00:02:09

passed #1334983
amd64 linux
gcc:tsan

00:01:57

passed #1334977
amd64 linux
gcc:tumbleweed:amd64

00:01:49

passed #1334979
amd64 linux
gcc:xenial:amd64

00:01:53

passed #1334993
amd64 windows
msvc:windows:amd64

00:01:13

passed #1334992
amd64 linux
nolibtool:sid:amd64

00:04:07

 
  Unit
passed #1335007
amd64 linux
unit:clang:asan

00:01:08

passed #1335012
amd64 linux
unit:clang:buster:amd64

00:00:32

passed #1335014
amd64 libvirt
unit:clang:freebsd11:amd64

00:01:10

passed #1335015
amd64 libvirt
unit:clang:freebsd12:amd64

00:00:55

passed #1335009
amd64 linux
unit:clang:tsan

00:04:01

passed #1334994
amd64 linux
unit:gcc:alpine3.12:amd64

00:00:37

passed #1335006
amd64 linux
unit:gcc:asan

00:01:09

passed #1335000
amd64 linux
unit:gcc:buster:amd64

00:01:11

passed #1334996
amd64 linux
unit:gcc:centos6:amd64

00:00:41

passed #1334995
i386 linux
unit:gcc:centos6:i386

00:00:36

passed #1334997
amd64 linux
unit:gcc:centos7:amd64

00:00:38

passed #1334998
amd64 linux
unit:gcc:centos8:amd64

00:00:33

passed #1335003
amd64 linux
unit:gcc:fedora33:amd64

00:00:36

passed #1335005
amd64 linux
unit:gcc:focal:amd64

00:00:33

passed #1335010
amd64 linux
unit:gcc:mutexatomics

00:00:36

passed #1335011
amd64 linux
unit:gcc:noatomics

00:00:30

passed #1335013
amd64 linux
unit:gcc:pkcs11

00:00:34

passed #1335001
amd64 linux
unit:gcc:sid:amd64

00:00:30

passed #1334999
amd64 linux
unit:gcc:stretch:amd64

00:00:34

passed #1335008
amd64 linux
unit:gcc:tsan

00:04:55

passed #1335002
amd64 linux
unit:gcc:tumbleweed:amd64

00:00:32

passed #1335004
amd64 linux
unit:gcc:xenial:amd64

00:00:36

passed #1335016
amd64 linux
unit:nolibtool:sid:amd64

00:00:45

 
  System
passed #1335030
amd64 linux
system:clang:asan

00:09:00

passed #1335035
amd64 linux
system:clang:buster:amd64

00:07:21

passed #1335037
amd64 libvirt
system:clang:freebsd11:amd64

00:08:29

passed #1335038
amd64 libvirt
system:clang:freebsd12:amd64

00:08:08

passed #1335032
amd64 linux
system:clang:tsan

00:11:44

passed #1335017
amd64 linux
system:gcc:alpine3.12:amd64

00:07:57

passed #1335029
amd64 linux
system:gcc:asan

00:09:25

passed #1335023
amd64 linux
system:gcc:buster:amd64

00:08:21

passed #1335019
amd64 linux
system:gcc:centos6:amd64

00:07:38

passed #1335018
i386 linux
system:gcc:centos6:i386

00:06:45

passed #1335020
amd64 linux
system:gcc:centos7:amd64

00:07:39

passed #1335021
amd64 linux
system:gcc:centos8:amd64

00:07:29

passed #1335026
amd64 linux
system:gcc:fedora33:amd64

00:07:24

passed #1335028
amd64 linux
system:gcc:focal:amd64

00:07:22

passed #1335033
amd64 linux
system:gcc:mutexatomics

00:07:15

passed #1335034
amd64 linux
system:gcc:noatomics

00:07:09

passed #1335036
amd64 linux
system:gcc:pkcs11

00:07:59

passed #1335024
amd64 linux
system:gcc:sid:amd64

00:07:08

passed #1335022
amd64 linux
system:gcc:stretch:amd64

00:07:00

passed #1335031
amd64 linux
system:gcc:tsan

00:12:56

passed #1335025
amd64 linux
system:gcc:tumbleweed:amd64

00:07:07

passed #1335027
amd64 linux
system:gcc:xenial:amd64

00:06:49

passed #1335039
amd64 linux
system:nolibtool:sid:amd64

00:07:21

 
  Docs
passed #1335040
amd64 linux
docs

00:00:29

 
  Postcheck
passed #1335044
amd64 linux
cppcheck

00:00:23

passed #1335041
amd64 linux
flake8

00:00:20

passed #1335045
amd64 linux
gcov

00:00:34

74.0%
passed #1335042
amd64 linux
pylint

00:00:22

passed #1335043
amd64 linux
scan-build

00:08:39