ithread_create() was relying on the stack not moving. Fix this.
authorNicholas Clark <nick@ccl4.org>
Thu, 13 Jan 2011 16:24:52 +0000 (16:24 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 13 Jan 2011 16:29:27 +0000 (16:29 +0000)
commit680818c0361b180bb6f09d4bb11c4d5cd467fe62
tree0af78c0b26c08fcb5d622f6c7050565d50298c01
parented47cbae1475c99fdcfd2a4da98c33346acd6d9a
ithread_create() was relying on the stack not moving. Fix this.

4cf5eae5e58faebb changed S_ithread_create() to avoid creating an AV, by
passing the thread creation arguments as pointers to a block of memory
holding SVs. Unfortunately, this inadvertently introduced a subtle bug,
because the block of memory is on the Perl stack, which can move as a side
effect of being reallocated to extend it. Hence pass in the offset on the
stack instead, read the current value of the relevant interpreter's stack
at the point of access, and copy all the SVs away before making any further
calls which might cause reallocation.
dist/threads/threads.xs