Fix scheduler build with some boost versions. #6285

pull theuni wants to merge 1 commits into bitcoin:master from theuni:boost-scheduler-fix changing 1 files +3 −1
  1. theuni commented at 7:51 PM on June 15, 2015: member

    Some boost versions have a conflicting public overload of wait_until that returns void. Explicitly use a template here to avoid hitting that overload.

    Tested against boost 1.52, which is confirmed broken -> fixed.

    For reference, here are the competing overloads (from thread/pthread/condition_variable_fwd.hpp):

            template <class Duration>
            cv_status
            wait_until(
                    unique_lock<mutex>& lock,
                    const chrono::time_point<chrono::system_clock, Duration>& t)
            {
    ...
            inline void wait_until(
                unique_lock<mutex>& lk,
                chrono::time_point<chrono::system_clock, chrono::nanoseconds> tp)
            {
    

    boost::chrono::system_clock::duration is typedef'd as chrono::nanoseconds, so without template params we end up falling into the void-return overload.

  2. gavinandresen commented at 7:54 PM on June 15, 2015: contributor

    utACK.

  3. Fix scheduler build with some boost versions.
    Some boost versions have a conflicting overload of wait_until that returns void.
    Explicitly use a template here to avoid hitting that overload.
    72bf90d770
  4. theuni force-pushed on Jun 15, 2015
  5. theuni commented at 8:32 PM on June 15, 2015: member

    Grr, that overload was only present for pthreads. Updated to provide no params, only hint at template usage.

  6. laanwj commented at 11:54 AM on June 16, 2015: member

    utACK, thanks!

  7. laanwj added the label Build system on Jun 16, 2015
  8. laanwj merged this on Jun 16, 2015
  9. laanwj closed this on Jun 16, 2015

  10. laanwj referenced this in commit 7fe29d84bd on Jun 16, 2015
  11. laanwj referenced this in commit ef1d506054 on Jun 16, 2015
  12. laanwj commented at 11:58 AM on June 16, 2015: member

    Cherry-picked to 0.11 as ef1d5060544fd4f468a19b090fabae5e3be84e1e

  13. MarcoFalke locked this on Sep 8, 2021

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-04-18 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me