]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbsupport/event-loop: do not truncate poll timeouts to lower second
authorPatrick Monnerat <patrick@monnerat.net>
Mon, 12 May 2025 15:36:17 +0000 (17:36 +0200)
committerPatrick Monnerat <patrick@monnerat.net>
Mon, 12 May 2025 15:47:35 +0000 (17:47 +0200)
commit5cceef276f36de70ac286b46721568385a1422d7
treeaeb31a7930506b0901afa1b4ab8d266e95e57503
parent4e16a470492e412b6652d1e992f49edbc8e90894
gdbsupport/event-loop: do not truncate poll timeouts to lower second

In update_wait_timeout function, microseconds were not taken into account
in poll timeout computation, resulting in 100% cpu time consumption in
the event loop while waiting for a sub-second timeout.

The bug has been introduced in commit c2c6d25.

This patch adds the microseconds converted to milliseconds in poll
timeout computation. Conversion by excess (ceil) is performed to
avoid the same problem with sub-millisecond timeouts too.
gdbsupport/event-loop.cc