util: Pass pthread_self() to pthread_setschedparam instead of 0 #12923

pull laanwj wants to merge 2 commits into bitcoin:master from laanwj:2018_04_pthread_self changing 1 files +2 −2
  1. laanwj commented at 1:47 PM on April 9, 2018: member

    Nowhere in the man page of pthread_setschedparam it is mentioned that 0 is a valid value. The example uses pthread_self(), so should we.

    (noticed by Anthony Towns) Fixes #12915.

  2. util: Pass pthread_self() to pthread_setschedparam instead of 0
    Nowhere in the man page of `pthread_setschedparam` it is mentioned that
    `0` is a valid value. The example uses `pthread_self()`, so should we.
    
    (noticed by Anthony Towns)
    cff66e6a29
  3. fanquake added the label Utils/log/libs on Apr 9, 2018
  4. MarcoFalke commented at 1:49 PM on April 9, 2018: member

    @eklitzke Mind to take a look here?

  5. MarcoFalke commented at 1:50 PM on April 9, 2018: member

    Concept ACK cff66e6a29 (fixes the issue for me, didn't review though)

  6. laanwj requested review from eklitzke on Apr 9, 2018
  7. practicalswift commented at 1:59 PM on April 9, 2018: contributor

    utACK cff66e6a29d700188f6ecebeaacc8bcaa1fc1095

  8. laanwj commented at 2:19 PM on April 9, 2018: member

    So on IRC it was mentioned that

    <aj> hmm, i thought designator initialisers (param{.sched_priority=0}) weren't ok for c++11 (http://en.cppreference.com/w/cpp/language/aggregate_initialization says they're c++20 fwiw)

    Should I make this change here too? It's curious that it does compile (as our build explicitly passes -std=c++11), but if it's not allowed by the standard we should probably change it.

  9. ajtowns commented at 2:34 PM on April 9, 2018: member

    utACK cff66e6a29d700188f6ecebeaacc8bcaa1fc1095

    Neither clang nor gcc seems to warn about designated initializers with c++11. I think this is the only use of one in the codebase currently, so removing it is probably fine.

  10. util: Remove designator initializer from ScheduleBatchPriority
    Although no compiler appears to complain about it, these are
    not valid for c++11.
    (http://en.cppreference.com/w/cpp/language/aggregate_initialization says they're c++20)
    
    The structure is defined as:
    
       struct sched_param {
           int sched_priority;
       };
    
    So passing 0 for the first field has the same effect.
    b86730a4d7
  11. promag commented at 3:04 PM on April 9, 2018: member

    utACK cff66e6.

    Should I make this change here too?

    Maybe just fix the problem for now.

    Looks good.

  12. promag commented at 3:18 PM on April 9, 2018: member

    utACK b86730a.

  13. ajtowns commented at 3:21 PM on April 9, 2018: member

    utACK b86730a4d74471378fbafb2bac9839110f520b76

  14. laanwj merged this on Apr 9, 2018
  15. laanwj closed this on Apr 9, 2018

  16. laanwj referenced this in commit a7cbe38ae2 on Apr 9, 2018
  17. sidhujag commented at 3:42 AM on April 23, 2018: none

    I Noticed this aswell.. fixed it with self()

  18. Fabcien referenced this in commit a402ac1486 on Aug 30, 2019
  19. UdjinM6 referenced this in commit 79b922e446 on Dec 16, 2020
  20. UdjinM6 referenced this in commit 0beadffbc9 on Dec 16, 2020
  21. PastaPastaPasta referenced this in commit f4f297a11d on Dec 16, 2020
  22. PastaPastaPasta referenced this in commit 1434b8a8f1 on Dec 18, 2020
  23. furszy referenced this in commit a3e1290a71 on Mar 13, 2021
  24. TheArbitrator referenced this in commit b324f72883 on Jun 4, 2021
  25. 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-13 15:15 UTC

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