about summary refs log tree commit diff
path: root/src/legacy
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2019-02-15 19:58:09 -0500
committerRich Felker <dalias@aerifal.cx>2019-02-15 21:02:42 -0500
commit04335d9260c076cf4d9264bd93dd3b06c237a639 (patch)
tree181e6ea99a282ce13c150cf874399d3f5e6b3526 /src/legacy
parent5b74eed3b301e2227385f3bf26d3bb7c2d822cf8 (diff)
downloadmusl-04335d9260c076cf4d9264bd93dd3b06c237a639.tar.gz
musl-04335d9260c076cf4d9264bd93dd3b06c237a639.tar.xz
musl-04335d9260c076cf4d9264bd93dd3b06c237a639.zip
always block signals for starting new threads, refactor start args
whether signals need to be blocked at thread start, and whether
unblocking is necessary in the entry point function, has historically
depended on intricacies of the cancellation design and on whether
there are scheduling operations to perform on the new thread before
its successful creation can be committed. future changes to track an
AS-safe list of live threads will require signals to be blocked
whenever changes are made to the list, so ...

prior to commits b8742f32602add243ee2ce74d804015463726899 and
40bae2d32fd6f3ffea437fa745ad38a1fe77b27e, a signal mask for the entry
function to restore was part of the pthread structure. it was removed
to trim down the size of the structure, which both saved a small
amount of stack space and improved code generation on archs where
small immediate displacements are less costly than arbitrary ones, by
limiting the range of offsets between the base of the thread
structure, its members, and the thread pointer. these commits moved
the saved mask to a special structure used only when special
scheduling was needed, in which case the pthread_create caller and new
thread had to synchronize with each other and could use this memory to
pass a mask.

this commit partially reverts the above two commits, but instead of
putting the mask back in the pthread structure, it moves all "start
argument" members out of the pthread structure, trimming it down
further, and puts them in a separate structure passed on the new
thread's stack. the code path for explicit scheduling of the new
thread is also changed to synchronize with the calling thread in such
a way to avoid spurious futex wakes.
Diffstat (limited to 'src/legacy')
0 files changed, 0 insertions, 0 deletions