sigchain: switch from __thread to pthread_setspecific.

__thread is implemented via emutls on Android, which will result in the
thread local variable being allocated again and leaked if it gets used
after it has been destructed already (e.g. by a later destructor
calling sigprocmask, or triggering a signal handler).

Switch to pthread_setspecific, which doesn't suffer from this problem.

Bug: http://b/36871013
Test: ran dalvikvm on a class that spins creating threads
Change-Id: Ie5deab453be387490ba30a0010e12f60d736c8ad
(cherry picked from commit 99875e9e6b5604cc8a970977d0f531a5035ad55c)
1 file changed