I don't want to rely on the critical regions implementation for core functionality, because adding it was quite controversial and there are a few more ideas for non-suspendable threads.
Also this pull is slightly incorrect. Calling malloc in the signal handler (through TLS access) is wrong because __tls_get_addr isn't async safe. Here you mitigate this problem because rt.tlsgc.init does a TLS access itself, thus any further TLS access in this thread will no longer call malloc.
It's still possible that malloc is already locked in one another thread while SIGUSR1 is delivered before this critical region.