Replace boost sleep_for with C++11 equivalent #11046

pull jonasschnelli wants to merge 1 commits into bitcoin:master from jonasschnelli:2017/08/boost_sleep_for changing 3 files +7 −74
  1. jonasschnelli commented at 6:31 PM on August 14, 2017: contributor

    Replaces boost::thread::sleep_for with C++ equivalent. Removes ugly boost sleep_for version check and compatibility control structure.

    Not meant for 0.15.

  2. Replace boost sleep_for with C++11 equivalent 2a59a5745f
  3. jonasschnelli added the label Refactoring on Aug 14, 2017
  4. laanwj commented at 6:37 PM on August 14, 2017: member

    Nice. The difference is that this one is not interruptible. Not sure if that still makes a difference, though. @theuni?

  5. practicalswift commented at 8:03 PM on August 14, 2017: contributor

    Very nice! Concept strong ACK :-)

  6. XingZheZ commented at 12:50 PM on August 16, 2017: none

    Great!

  7. XingZheZ commented at 12:51 PM on August 16, 2017: none

    可能还有细节需要考虑。

  8. theuni commented at 4:02 AM on August 17, 2017: member

    Yes, we can't do this just yet. This would make MilliSleep non-interruptible, meaning that a few threads (see upnp for an easy example) would hang around for several minutes before dying.

    Due to the renewed interest (see #10923) as well, I'll finish up the std thread/mutex/condvar conversion asap so that we can proceed with changes like these. There aren't many left now.

  9. fanquake added this to the "In progress" column in a project

  10. in src/test/scheduler_tests.cpp:14 in 2a59a5745f
      10 | @@ -11,6 +11,9 @@
      11 |  #include <boost/thread.hpp>
      12 |  #include <boost/test/unit_test.hpp>
      13 |  
      14 | +#include <chrono>
    


    promag commented at 10:35 PM on September 4, 2017:

    Remove, it's included in thread header.

  11. in src/test/scheduler_tests.cpp:15 in 2a59a5745f
      10 | @@ -11,6 +11,9 @@
      11 |  #include <boost/thread.hpp>
      12 |  #include <boost/test/unit_test.hpp>
      13 |  
      14 | +#include <chrono>
      15 | +#include <thread>
    


    promag commented at 10:35 PM on September 4, 2017:

    Include before boost headers.

  12. in src/utiltime.cpp:13 in 2a59a5745f
       9 | @@ -10,9 +10,10 @@
      10 |  #include "utiltime.h"
      11 |  
      12 |  #include <atomic>
      13 | +#include <chrono>
    


    promag commented at 10:35 PM on September 4, 2017:

    Remove.

  13. laanwj commented at 1:37 PM on October 4, 2017: member

    Closing for now, as we can't do this yet. Please rebase and reopen once the dependencies went in.

  14. laanwj closed this on Oct 4, 2017

  15. fanquake moved this from the "In progress" to the "Later" column in a project

  16. MarcoFalke commented at 6:58 PM on February 21, 2020: member

    After f26866b9caf9ff27d129c703f51b8c2922000243, this should now be possible to do. See here: #16117

  17. MarcoFalke moved this from the "Later" to the "Done" column in a project

  18. DrahtBot 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-04-22 06:15 UTC

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