Use %gs as TLS register when dlopen() is linked

Fixes #938
This commit is contained in:
Justine Tunney 2023-11-08 01:11:17 -08:00
parent e961385e55
commit d71da7fc72
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
13 changed files with 71 additions and 40 deletions

View file

@ -35,6 +35,7 @@ static textwindows int _park_thread(uint32_t msdelay, sigset_t waitmask,
if ((sig = __sig_get(waitmask))) goto HandleSignal;
int expect = 0;
atomic_int futex = 0;
int handler_was_called;
struct PosixThread *pt = _pthread_self();
pt->pt_blkmask = waitmask;
atomic_store_explicit(&pt->pt_blocker, &futex, memory_order_release);
@ -42,7 +43,7 @@ static textwindows int _park_thread(uint32_t msdelay, sigset_t waitmask,
atomic_store_explicit(&pt->pt_blocker, 0, memory_order_release);
if (ok && (sig = __sig_get(waitmask))) {
HandleSignal:
int handler_was_called = __sig_relay(sig, SI_KERNEL, waitmask);
handler_was_called = __sig_relay(sig, SI_KERNEL, waitmask);
if (_check_cancel() == -1) return -1;
if (!restartable || (handler_was_called & SIG_HANDLED_NO_RESTART)) {
return eintr();