scheduler: Workaround negative nsecs bug in boost's wait_until #18271

pull luke-jr wants to merge 1 commits into bitcoin:master from luke-jr:wrkarnd_boost_wait_until changing 1 files +14 −2
  1. luke-jr commented at 10:43 PM on March 5, 2020: member

    Some boost versions have a bug that can cause a time prior to system boot (or wake from sleep) to throw an exception instead of return timeout See https://github.com/boostorg/thread/issues/308

    Fixes #18227

    Cleanly merges to 0.14+

  2. DrahtBot commented at 1:42 AM on March 6, 2020: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  3. DrahtBot cross-referenced this on Mar 6, 2020 from issue build: Remove Boost Chrono by fanquake
  4. DrahtBot cross-referenced this on Mar 6, 2020 from issue refactor: Replace boost::mutex,condition_var,chrono with std equivalents in scheduler by ajtowns
  5. ajtowns commented at 2:46 AM on March 6, 2020: contributor

    I think travis is failing because this catches boost::thread_interrupted and sometimes doesn't rethrow it. Checking timeToWaitFor <= ::now() prior to calling wait_until might work better?

  6. scheduler: Workaround negative nsecs bug in boost's wait_until
    Some boost versions have a bug that can cause a time prior to system boot (or wake from sleep) to throw an exception instead of return timeout
    See https://github.com/boostorg/thread/issues/308
    ed0223ec59
  7. luke-jr force-pushed on Mar 6, 2020
  8. luke-jr commented at 3:55 AM on March 6, 2020: member

    That could break in a race (suspend after check, but before wait_until).

    Fixed it by always rethrowing boost::thread_interrupted reliably.

  9. MarcoFalke commented at 7:47 PM on March 6, 2020: member

    Please enable the mockscheduler unit test again

  10. luke-jr closed this on Mar 6, 2020

  11. div72 cross-referenced this on Sep 15, 2020 from issue gridcoinresearch crashes after the machine is woken up by bzaborow
  12. bitcoin locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:54 UTC