tsan: add support for idle threads

llvm-svn: 177292
This commit is contained in:
Dmitry Vyukov 2013-03-18 17:21:15 +00:00
parent 91907cbe82
commit 61ce9560d4
1 changed files with 5 additions and 0 deletions

View File

@ -234,4 +234,9 @@ uptr __tsan_get_allocated_size(void *p) {
MBlock *b = (MBlock*)allocator()->GetMetaData(p);
return b->size;
}
void __tsan_on_thread_idle() {
ThreadState *thr = cur_thread();
allocator()->SwallowCache(&thr->alloc_cache);
}
} // extern "C"