util: Pass pthread_self() to pthread_setschedparam instead of 0#12923
util: Pass pthread_self() to pthread_setschedparam instead of 0#12923laanwj merged 2 commits intobitcoin:masterfrom
Conversation
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)
|
@eklitzke Mind to take a look here? |
|
Concept ACK cff66e6 (fixes the issue for me, didn't review though) |
|
utACK cff66e6 |
|
So on IRC it was mentioned that
Should I make this change here too? It's curious that it does compile (as our build explicitly passes |
|
utACK cff66e6 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. |
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.
|
utACK cff66e6.
Looks good. |
|
utACK b86730a. |
|
utACK b86730a |
…ead of 0 b86730a util: Remove designator initializer from ScheduleBatchPriority (Wladimir J. van der Laan) cff66e6 util: Pass pthread_self() to pthread_setschedparam instead of 0 (Wladimir J. van der Laan) Pull request description: 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. Tree-SHA512: 249e93b1ae7e3ba28de6ee6288400b91d21ca1b4ca41d82211f6c9609b62deb5ac87182c7bf08471d3a3e0c1af314c9ecd41f8ae864febe963b1de8a816dd82f
|
I Noticed this aswell.. fixed it with self() |
…ead of 0 Summary: b86730a util: Remove designator initializer from ScheduleBatchPriority (Wladimir J. van der Laan) cff66e6 util: Pass pthread_self() to pthread_setschedparam instead of 0 (Wladimir J. van der Laan) Pull request description: 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. Tree-SHA512: 249e93b1ae7e3ba28de6ee6288400b91d21ca1b4ca41d82211f6c9609b62deb5ac87182c7bf08471d3a3e0c1af314c9ecd41f8ae864febe963b1de8a816dd82f Backport of Core PR12923 bitcoin/bitcoin#12923 Depends on D3953 Test Plan: make check test_runner.py Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: deadalnix, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3954
…am instead of 0 b86730a util: Remove designator initializer from ScheduleBatchPriority (Wladimir J. van der Laan) cff66e6 util: Pass pthread_self() to pthread_setschedparam instead of 0 (Wladimir J. van der Laan) Pull request description: 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 bitcoin#12915. Tree-SHA512: 249e93b1ae7e3ba28de6ee6288400b91d21ca1b4ca41d82211f6c9609b62deb5ac87182c7bf08471d3a3e0c1af314c9ecd41f8ae864febe963b1de8a816dd82f
…ead of 0 48b3bc4 util: Remove designator initializer from ScheduleBatchPriority (Wladimir J. van der Laan) 886b6ca util: Pass pthread_self() to pthread_setschedparam instead of 0 (Wladimir J. van der Laan) Pull request description: Coming straight from bitcoin#12923. Fixes a bug introduced in #2212 for **some** POSIX linux systems (observed on CentOS 7 currently) Original upstream text: > 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. ACKs for top commit: furszy: utACK 48b3bc4 random-zebra: utACK 48b3bc4 Tree-SHA512: b7976efbe4659a20ca88e958dc419d6cf9a11867c0a1dc021af722f5878b4574a160680b35fecca348231c5477f52fd0a1e336f76968127acf0f5c018e2b6de7
…am instead of 0 b86730a util: Remove designator initializer from ScheduleBatchPriority (Wladimir J. van der Laan) cff66e6 util: Pass pthread_self() to pthread_setschedparam instead of 0 (Wladimir J. van der Laan) Pull request description: 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 bitcoin#12915. Tree-SHA512: 249e93b1ae7e3ba28de6ee6288400b91d21ca1b4ca41d82211f6c9609b62deb5ac87182c7bf08471d3a3e0c1af314c9ecd41f8ae864febe963b1de8a816dd82f
Nowhere in the man page of
pthread_setschedparamit is mentioned that0is a valid value. The example usespthread_self(), so should we.(noticed by Anthony Towns)
Fixes #12915.