]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commit - Magic.xs
Don't lock the VMG_LOADED mutex across global destruction
authorVincent Pit <vince@profvince.com>
Thu, 9 Apr 2015 18:12:26 +0000 (15:12 -0300)
committerVincent Pit <vince@profvince.com>
Tue, 14 Apr 2015 14:42:58 +0000 (11:42 -0300)
commit64d80b88646a16ec430354d4139798d152f0e3ca
tree7d4429e3b6a64767c281ad3ed2e988a63e8a8aa4
parent34c317825d931337c0d5cdc6b365ca9a16906310
Don't lock the VMG_LOADED mutex across global destruction

If this mutex falls back to the OP_REFCNT mutex, and that a coderef is
freed during global destruction, the mutex is taken twice and the process
hangs. As a general rule, it does not seem very safe so we just set
vmg_loaded to zero early and only run the global teardown callback if
it is zero. This ensures that this callback will only be called once.
Magic.xs