aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2021-11-19 14:26:07 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2021-11-19 14:26:07 +0100
commitd686cb0d740b0278fdbd7915f43faff14b203888 (patch)
tree8f7615b8e9467f6d2d9e5b352f4f04e4602e2403
parentea2954df43d4162af23a20c84f4c5485463977ac (diff)
downloadgcc-d686cb0d740b0278fdbd7915f43faff14b203888.zip
gcc-d686cb0d740b0278fdbd7915f43faff14b203888.tar.gz
gcc-d686cb0d740b0278fdbd7915f43faff14b203888.tar.bz2
libphobos: Don't call __gthread_key_delete in the emutls destroy function.
Fixes a EXC_BAD_ACCESS issue seen on Darwin when the libphobos DSO gets unloaded. Based on reading libgcc's emutls implementation, as it doesn't call __gthread_key_delete directly, neither should libphobos. libphobos/ChangeLog: * libdruntime/gcc/emutls.d (emutlsDestroyThread): Don't remove entry from global array. (_d_emutls_destroy): Don't call __gthread_key_delete.
-rw-r--r--libphobos/libdruntime/gcc/emutls.d6
1 files changed, 0 insertions, 6 deletions
diff --git a/libphobos/libdruntime/gcc/emutls.d b/libphobos/libdruntime/gcc/emutls.d
index 4237dc7..4622305 100644
--- a/libphobos/libdruntime/gcc/emutls.d
+++ b/libphobos/libdruntime/gcc/emutls.d
@@ -229,9 +229,6 @@ void** emutlsAlloc(shared __emutls_object* obj) nothrow @nogc
extern (C) void emutlsDestroyThread(void* ptr) nothrow @nogc
{
auto arr = cast(TlsArray*) ptr;
- emutlsMutex.lock_nothrow();
- emutlsArrays.remove(arr);
- emutlsMutex.unlock_nothrow();
foreach (entry; *arr)
{
@@ -308,9 +305,6 @@ void _d_emutls_scan(scope void delegate(void* pbeg, void* pend) nothrow cb) noth
// Call this after druntime has been unloaded
void _d_emutls_destroy() nothrow @nogc
{
- if (__gthread_key_delete(emutlsKey) != 0)
- abort();
-
(cast(Mutex) _emutlsMutex.ptr).__dtor();
destroy(emutlsArrays);
}