This is an archive of the discontinued LLVM Phabricator instance.

Detect thread termination in LSan/NetBSD
ClosedPublic

Authored by krytarowski on Nov 25 2017, 8:41 AM.

Details

Summary

Stop using the Linux solution with pthread_key_create(3).
This approach does not work on NetBSD, because calling
the thread destructor is not the latest operation on a POSIX
thread entity.

Detect _lwp_exit(2) call as it is really the latest operation
called from a detaching POSIX thread.

The pthread_key_create(3) solution also cannot be used
in early libc/libpthread initialization on NetBSD as the
system libraries are not bootstrapped enough.

Sponsored by <The NetBSD Foundation>

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Nov 25 2017, 8:41 AM
dvyukov accepted this revision.Nov 26 2017, 12:11 AM
This revision is now accepted and ready to land.Nov 26 2017, 12:11 AM
krytarowski closed this revision.Nov 26 2017, 1:42 AM