meson: add missing semicolon in pthread_condattr_setclock test
PATCH 1/1 meson: add missing semicolon in pthread_condattr_setclock test
The test code was missing a semicolon after the pthread_condattr_t variable declaration.
--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
@@ -2882,7 +2882,7 @@ config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(osdep_prefix + int main(void) { - pthread_condattr_t attr + pthread_condattr_t attr; pthread_condattr_init(&attr); pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); return 0;
Signature · 1 line
2.34.1
Hi
Quoted 5 lines · Stepan Popov
The test code was missing a semicolon after the
pthread_condattr_tvariable declaration.Signed-off-by Stepan Popov <[email protected]>
QemuSemaphore")
Quoted 20 lines
--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meson.build +1
-2@@ -2882,7 +2882,7 @@ config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(osdep_prefix + int main(void) { - pthread_condattr_t attr + pthread_condattr_t attr; pthread_condattr_init(&attr); pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); return 0; --2.34.1
Quoted 11 lines · Marc-André Lureau
Hi
Quoted 5 lines · Stepan Popov
The test code was missing a semicolon after the
pthread_condattr_tvariable declaration.Signed-off-by Stepan Popov <[email protected]>Fixes 657ac98b58 ("thread-posix: use monotonic clock for QemuCond andQemuSemaphore")
IOW, that commit has been dead code since it was first added years ago, we've never used the monotonic clock
Quoted 12 lines
Reviewed-by Marc-André Lureau <[email protected]>Quoted 10 lines
--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meson.build +0
-0@@ -2882,7 +2882,7 @@ config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(osdep_prefix +
Quoted 11 lines
Quoted 10 lines
meson.build +1
-2int main(void) { - pthread_condattr_t attr + pthread_condattr_t attr; pthread_condattr_init(&attr); pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); return 0; --2.34.1
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Quoted 9 lines · Daniel P. Berrangé
Quoted 7 lines · Marc-André Lureau
Hi
Quoted 4 lines · Stepan Popov
The test code was missing a semicolon after the
pthread_condattr_tvariable declaration.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Stepan Popov <[email protected]>Fixes 657ac98b58 ("thread-posix: use monotonic clock for QemuCond andQemuSemaphore")
IOW, that commit has been dead code since it was first added years ago, we've never used the monotonic clock
Yes. So are we confident enough in that never-tested feature to want to enable it at this point in the release cycle, or should we hold off on this bugfix until 11.1 ?
-- PMM
Quoted 15 lines · Peter Maydell
Quoted 14 lines · Daniel P. Berrangé
Quoted 11 lines · Marc-André Lureau
Hi
Quoted 5 lines · Stepan Popov
The test code was missing a semicolon after the
pthread_condattr_tvariable declaration.Signed-off-by Stepan Popov <[email protected]>Fixes 657ac98b58 ("thread-posix: use monotonic clock for QemuCond andQemuSemaphore")
Quoted 6 lines
Quoted 2 lines
IOW, that commit has been dead code since it was first added years ago, we've never used the monotonic clock
Yes. So are we confident enough in that never-tested feature to want to enable it at this point in the release cycle, or should we hold off on this bugfix until 11.1 ?
IMHO waiting until 11.1 is the prudent approach. This is not a regression fix and clearly no one noticed it wasn't doing anything for 3 years since it was introduced, so fixing it can't be that urgent ?
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Quoted 6 lines · Peter Maydell
Quoted 2 lines
IOW, that commit has been dead code since it was first added years ago, we've never used the monotonic clock
Yes. So are we confident enough in that never-tested feature to want to enable it at this point in the release cycle, or should we hold off on this bugfix until 11.1 ?
In practice the difference between the two is almost always unnoticeable. Because it affects pthread_cond_timedwait, the only difference would mean making a timeout slighly shorter or longer... and just once. It's just unaesthetic to use CLOCK_REALTIME instad of CLOCK_MONOTONIC.
Paolo
Quoted 13 lines · Stepan Popov
The test code was missing a semicolon after the
pthread_condattr_tvariable declaration.Signed-off-by Stepan Popov <[email protected]>--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meson.build +0
-0
meson.build config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(osdep_prefix + · line 2888
Quoted 8 lines
meson.build +1
-1@@ -2882,7 +2882,7 @@ config_host_data.set('CONFIG_PTHREAD_CONDATTR_SETCLOCK', cc.links(osdep_prefix + int main(void) { - pthread_condattr_t attr + pthread_condattr_t attr; pthread_condattr_init(&attr); pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); return 0;
Good catch:
I guess we've just been silently failing that test since it was introduced then?
Cached compiler stderr:
/home/alex/lsrc/qemu.git/builds/all/meson-private/tmpy5s2fh25/testfile.c: In function 'main':
/home/alex/lsrc/qemu.git/builds/all/meson-private/tmpy5s2fh25/testfile.c:23:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pthread_condattr_init'
23 | pthread_condattr_init(&attr);
| ^~~~~~~~~~~~~~~~~~~~~
/home/alex/lsrc/qemu.git/builds/all/meson-private/tmpy5s2fh25/testfile.c:23:28: error: 'attr' undeclared (first use in this function)
23 | pthread_condattr_init(&attr);
| ^~~~ /home/alex/lsrc/qemu.git/builds/all/meson-private/tmpy5s2fh25/testfile.c:23:28: note: each undeclared identifier is reported only once for each function it appears in
Using cached compile:
Cached command line: cc -m64 /home/alex/lsrc/qemu.git/builds/all/meson-private/tmppx1fde_i/testfile.c -o /home/alex/lsrc/qemu.git/builds/all/meson-private/tmppx1fde_i/output.exe -pthread -D_FILE_OFFSET_BITS=64 -O0 -std=gnu11
So maybe:
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro
Paolo Bonzini
AppliedQueued, thanks.
Paolo