aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-09-02 12:29:04 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2024-09-14 13:46:30 +0100
commit01670a4095791733e0389acead832e3da757c9d7 (patch)
tree73655a8f306a480ffbe7dcde016eafadccaedf8f /gcc
parent49cb7150f0e93e8332f4b78753675b255a5c58f2 (diff)
downloadgcc-01670a4095791733e0389acead832e3da757c9d7.zip
gcc-01670a4095791733e0389acead832e3da757c9d7.tar.gz
gcc-01670a4095791733e0389acead832e3da757c9d7.tar.bz2
libstdc++: Refactor loops in std::__platform_semaphore
Refactor the loops to all use the same form, and to not need explicit 'break' or 'continue' jumps. This also avoids a -Wunused-variable warning with -Wsystem-headers. Also fix a bug for absolute timeouts specified with a time that isn't implicitly convertible to __clock_t::time_point, e.g. one with a higher resolution such as picoseconds. Use chrono::ceil to round up to the next time point representable by the clock. libstdc++-v3/ChangeLog: * include/bits/semaphore_base.h (__platform_semaphore): Refactor loops to all use similar forms. (__platform_semaphore::_M_try_acquire_until): Use chrono::ceil to explicitly convert to __clock_t::time_point. * testsuite/30_threads/semaphore/try_acquire_for.cc: Check that using a very high resolution timeout compiles. * testsuite/30_threads/semaphore/platform_try_acquire_for.cc: New test.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions