fix locking issue with new mempool limiting #6889

pull jonasschnelli wants to merge 1 commits into bitcoin:master from jonasschnelli:2015/10/fix_mempool_lock changing 2 files +9 −3
  1. jonasschnelli commented at 1:57 PM on October 26, 2015: contributor

    Current master crashes on OSX with an exception: "boost: mutex lock failed in pthread_mutex_lock: Invalid argument".

    mempool is a global object and gets initialized over cxx_global_var_init(). Calling LOCK() within constructor (of a object in global scope) is problematic (at least on OSX).

  2. fix locking issue with new mempool limiting
    Current master crashes on OSX with an exception: "boost: mutex lock failed in pthread_mutex_lock: Invalid argument"
    0d699fc821
  3. jonasschnelli force-pushed on Oct 26, 2015
  4. laanwj added the label Bug on Oct 26, 2015
  5. laanwj commented at 4:36 PM on October 26, 2015: member

    utACK

  6. jonasschnelli commented at 8:25 PM on October 26, 2015: contributor

    The issue that this PR solves was introduced in #6722

  7. petertodd commented at 9:24 PM on October 26, 2015: contributor

    utACK

  8. in src/txmempool.h:None in 0d699fc821
     374 | @@ -375,6 +375,7 @@ class CTxMemPool
     375 |      void removeForBlock(const std::vector<CTransaction>& vtx, unsigned int nBlockHeight,
     376 |                          std::list<CTransaction>& conflicts, bool fCurrentEstimate = true);
     377 |      void clear();
    


    dcousens commented at 1:20 AM on October 27, 2015:

    nit: lockAndClear/clearSync maybe?


    laanwj commented at 7:41 AM on October 27, 2015:

    Usually projects have some convention for this (eg _XX and XX, or XX_nolock and XX) . Where one is used internally (when lock already held) and the other externally (locks and calls inner function). Preferable to have the names as similar as possible with just the lock/nonlock difference. lockAndClear and clearSync are too far apart to be easily recognizable as a set. So IMO the current naming is better.


    dcousens commented at 10:28 PM on October 27, 2015:

    :+1: just not something I'd seen before.

  9. dcousens commented at 1:20 AM on October 27, 2015: contributor

    utACK

  10. laanwj merged this on Oct 27, 2015
  11. laanwj closed this on Oct 27, 2015

  12. laanwj referenced this in commit 38369dda32 on Oct 27, 2015
  13. furszy referenced this in commit eb00d0f62f on Jun 14, 2020
  14. zkbot referenced this in commit 65dff184f6 on Aug 4, 2021
  15. zkbot referenced this in commit 6f38962577 on Aug 5, 2021
  16. zkbot referenced this in commit 1aa59fd4ac on Aug 5, 2021
  17. zkbot referenced this in commit 8c3d670c8a on Aug 9, 2021
  18. zkbot referenced this in commit 1dc1ababa9 on Aug 9, 2021
  19. zkbot referenced this in commit 18fe0a377b on Aug 9, 2021
  20. zkbot referenced this in commit 1cb1ed2653 on Aug 10, 2021
  21. 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-24 12:15 UTC

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