Skip to content

Conversation

@theuni
Copy link
Member

@theuni theuni commented Jun 15, 2015

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.

@gavinandresen
Copy link
Contributor

utACK.

Some boost versions have a conflicting overload of wait_until that returns void.
Explicitly use a template here to avoid hitting that overload.
@theuni theuni force-pushed the boost-scheduler-fix branch from 0116e92 to 72bf90d Compare June 15, 2015 20:32
@theuni
Copy link
Member Author

theuni commented Jun 15, 2015

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

@laanwj
Copy link
Member

laanwj commented Jun 16, 2015

utACK, thanks!

@laanwj laanwj merged commit 72bf90d into bitcoin:master Jun 16, 2015
laanwj added a commit that referenced this pull request Jun 16, 2015
72bf90d Fix scheduler build with some boost versions. (Cory Fields)
laanwj pushed a commit that referenced this pull request Jun 16, 2015
Some boost versions have a conflicting overload of wait_until that returns void.
Explicitly use a template here to avoid hitting that overload.

Github-Pull: #6285
Rebased-From: 72bf90d
@laanwj
Copy link
Member

laanwj commented Jun 16, 2015

Cherry-picked to 0.11 as ef1d506

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants