Fix portability issue with pthreads #15968

pull grim-trigger wants to merge 1 commits into bitcoin:master from grim-trigger:master changing 1 files +5 −0
  1. grim-trigger commented at 0:19 am on May 7, 2019: contributor

    This change resolves the following issue: #15951

    Only tested on OpenBSD 6.5/amd64

  2. Fix portability issue with pthreads
    This change resolves the following issue:
    https://github.com/bitcoin/bitcoin/issues/15951
    
    Only tested on OpenBSD 6.5/amd64
    1b05dff080
  3. fanquake added the label Linux/Unix on May 7, 2019
  4. fanquake added the label Utils/log/libs on May 7, 2019
  5. fanquake commented at 8:14 am on May 7, 2019: member

    tACK 1b05dff. Tested on OpenBSD6.4 (vagrant).

    Pre patch:

    0  CXX      util/libbitcoin_util_a-rbf.o
    1  CXX      util/libbitcoin_util_a-threadnames.o
    2util/threadnames.cpp:26:5: error: use of undeclared identifier 'pthread_set_name_np'
    3    pthread_set_name_np(pthread_self(), name);
    4    ^
    51 error generated.
    6gmake[2]: *** [Makefile:8666: util/libbitcoin_util_a-threadnames.o] Error 1
    7gmake[2]: *** Waiting for unfinished jobs....
    

    with this PR make check builds and all tests pass.

  6. MarcoFalke added the label Needs gitian build on May 7, 2019
  7. laanwj commented at 10:15 am on May 8, 2019: member
    utACK 1b05dff080fe50937a02cfde661db58ace21c553 (I think it’d be slightly better, at least more general, to detect the need for these includes in the configure script, but this is fine to work around the immediate issue)
  8. DrahtBot commented at 10:16 am on May 8, 2019: member

    Gitian builds for commit 3632143ebbfdd4888571db800c8ee8d684eec57b (master):

    Gitian builds for commit 1da169961518949bed9f1811e3d1345dedd4061a (master and this pull):

  9. DrahtBot removed the label Needs gitian build on May 8, 2019
  10. grim-trigger commented at 10:52 pm on May 9, 2019: contributor

    @laanwj

    (I think it’d be slightly better, at least more general, to detect the need for these includes in the configure script, but this is fine to work around the immediate issue)

    I agree that the most general way is best. I just followed the existing convention from https://github.com/bitcoin/bitcoin/blob/master/src/util/system.cpp :

    0#if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))
    1#include <pthread.h>
    2#include <pthread_np.h>
    3#endif
    

    Is there anything else I need to do?

  11. laanwj commented at 12:17 pm on May 16, 2019: member
    No, it’s ok, going to merge this, sorry for the delay.
  12. laanwj merged this on May 16, 2019
  13. laanwj closed this on May 16, 2019

  14. laanwj referenced this in commit 47ec8318a6 on May 16, 2019
  15. sidhujag referenced this in commit c78ed7fe76 on May 18, 2019
  16. deadalnix referenced this in commit bd90ec8360 on Mar 24, 2020
  17. ftrader referenced this in commit 2ac5ab36d5 on Dec 1, 2020
  18. linuxsh2 referenced this in commit 13b0efe1bd on Aug 11, 2021
  19. DrahtBot locked this on Dec 16, 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: 2024-11-21 15:12 UTC

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