diff options
author | David Mitchell <davem@iabyn.com> | 2019-02-18 09:19:38 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-02-19 13:28:12 +0000 |
commit | 61d4c87c940fea028f08f27addc275b469320fda (patch) | |
tree | 2b3ec59900f4afb0db365dc392699b335b6922bf /perlvars.h | |
parent | 6009fde9e4e3d825057f663d300a7bede478e5c3 (diff) | |
download | perl-61d4c87c940fea028f08f27addc275b469320fda.tar.gz |
Perl_my_cxt_init: fix potential race condition
(Found by code inspection - I can't reproduce a failure)
the MY_CXT subsystem, which allows per-thread pseudo-static variables,
has a thread race condition.
When a module is first loaded, it is allocated unique index (from
PL_my_cxt_index++) which is assigned to the module's my_cxt_index static
var.
If two threads both try to load an XS module at the same time, its
possible for one thread to set my_cxtp, then a second thread to overwrite
it with a higher value, causing the first thread to use the wrong index
into its local storage.
Diffstat (limited to 'perlvars.h')
0 files changed, 0 insertions, 0 deletions