Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Fix #391 for PHP 5.x #477

Merged
merged 3 commits into from Aug 27, 2015
Merged

Fix #391 for PHP 5.x #477

merged 3 commits into from Aug 27, 2015

Conversation

sagebind
Copy link

An attempt at fixing #391 for PHP versions 5.x.

As per the pthreads 2.0.x docs, resources and objects should be nullified inside static variables, so now pthreads_copy_statics() skips over those types of values when copying lexical statics by simple type checking. The entry for the variable will instead be empty, which will return a fresh NULL after copy to a child thread. Normal zvals are copied and their refcounts incremented.

@krakjoe
Copy link
Owner

krakjoe commented Aug 27, 2015

You need to omit copying arrays in the same way for this to work as intended.

Z_TYPE_P(* can be replaced with Z_TYPE_PP in 5

Also, add array case to test for completeness.

Thanks for taking the time ;)

@sagebind
Copy link
Author

OK, will do. Thanks for the tip!

krakjoe added a commit that referenced this pull request Aug 27, 2015
@krakjoe krakjoe merged commit 0d7db90 into krakjoe:master Aug 27, 2015
@krakjoe
Copy link
Owner

krakjoe commented Aug 27, 2015

Excellent work, thanks again @CoderStephen

Sorry I can't find more time to work on the 5 branch, there are a couple of other outstanding issues, when seven is out the door, we'll try and get some of them cleared up for a final release on pecl for the 5 series.

@sagebind
Copy link
Author

Glad I can help! Don't feel bad -- it sounds like you've got enough on your plate already.

The only reason I'm so eager for the 5 branch (:smile:) is because I'm simultaneously working on icicleio/concurrent to be 5.x compatible primarily. And I think we're doing some new, unique types of things with pthreads that uncover bugs no one else even noticed. I'm really looking forward to becoming 7 compatible too when pthreads 3 is released.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants