search for: cur_thread_placeholder

Displaying 3 results from an estimated 3 matches for "cur_thread_placeholder".

2015 Aug 18
5
TSAN hack on AArch64 for Android
...it is actually quite fast and does not call any other system function (except get_thread() which is basically an access to real tls). So we can use it, and then the whole support becomes merely: INLINE ThreadState *cur_thread() { #ifdef REAL_TLS return reinterpret_cast<ThreadState *>(&cur_thread_placeholder); #else return reinterpret_cast<ThreadState *>(pthread_getspecific(thread_key)); #endif } Which looks quite acceptable to me. Also we could try to ask android to dedicate a real tls slot for sanitizers (I don't know what are the chances, but ART obviously get a one). Then we can chang...
2015 Aug 18
2
TSAN hack on AArch64 for Android
On Tue, Aug 18, 2015 at 8:28 PM, Kostya Serebryany <kcc at google.com> wrote: > +dvyukov > > On Mon, Aug 17, 2015 at 8:37 AM, Renato Golin <renato.golin at linaro.org> > wrote: >> >> Folks, >> >> The review of patch http://reviews.llvm.org/D11532 is extremely slow >> due to the number of hacks, left-overs and general undesired changes >>
2015 Aug 19
2
TSAN hack on AArch64 for Android
...or it should, as it actually > should have been a preparatory patch, submitted after all interested > parties agreed that TLS emulation is the way to go. > > >> INLINE ThreadState *cur_thread() { >> #ifdef REAL_TLS >> return reinterpret_cast<ThreadState *>(&cur_thread_placeholder); >> #else >> return reinterpret_cast<ThreadState *>(__get_tls()[ANDROID_TSAN_TLS_SLOT]); >> #endif >> } >> >> Which is roughly the same code-wise, but faster and safer. > > Dan "Eastwood" Albert has pulled the trigger. :) > > This l...