drop use of pthread_once for aio thread stack size init
authorRich Felker <dalias@aerifal.cx>
Tue, 8 Dec 2020 23:02:39 +0000 (18:02 -0500)
committerRich Felker <dalias@aerifal.cx>
Tue, 8 Dec 2020 23:02:39 +0000 (18:02 -0500)
commitb67d56c7b3b0f84360db749aa6f431a07761d9c8
treeebb174d2dc4c9a912e9870c8601d32a81ff30718
parent90ff016996753d83263445940710c87d9afa71f3
drop use of pthread_once for aio thread stack size init

pthread_once is not compatible with MT-fork constraints (commit
167390f05564e0a4d3fcb4329377fd7743267560) and is not needed here
anyway; we already have a lock suitable for initialization.

while changing this, fix a corner case where AT_MINSIGSTKSZ gives a
value that's more than MINSIGSTKSZ but by a margin of less than
2048, thereby causing the size to be reduced. it shouldn't matter but
the intent was to be the larger of a 2048-byte margin over the legacy
fixed minimum stack requirement or a 512-byte margin over the minimum
the kernel reports at runtime.
src/aio/aio.c