Temporary fix for target tests.
Avoid a race in pthread_join which causes us to free the memmap
stack before it is done being used.
Bug: 11693195
Change-Id: Ic453359cebc7395e10e83319aa25528b8d1f3882
diff --git a/runtime/thread_pool.cc b/runtime/thread_pool.cc
index aca0561..67fcd58 100644
--- a/runtime/thread_pool.cc
+++ b/runtime/thread_pool.cc
@@ -43,6 +43,8 @@
ThreadPoolWorker::~ThreadPoolWorker() {
CHECK_PTHREAD_CALL(pthread_join, (pthread_, NULL), "thread pool worker shutdown");
+ // TODO: Delete this when race condition in pthread_join is fixed.
+ usleep(500);
}
void ThreadPoolWorker::Run() {