Snap for 4767765 from 775fb09621 to pi-release

Change-Id: I5751f0e466bf7ea8abbb09beec054ec5b7e4222d
This commit is contained in:
android-build-team Robot 2018-05-08 07:23:52 +00:00
commit 33c964f5fe

View file

@ -107,10 +107,17 @@ std::ostream& operator<<(std::ostream& os, const LeakChecker& lc) {
// http://b/36045112 // http://b/36045112
TEST(pthread_leak, join) { TEST(pthread_leak, join) {
LeakChecker lc; LeakChecker lc;
for (int i = 0; i < 100; ++i) {
pthread_t thread; for (size_t pass = 0; pass < 2; ++pass) {
ASSERT_EQ(0, pthread_create(&thread, nullptr, [](void*) -> void* { return nullptr; }, nullptr)); for (int i = 0; i < 100; ++i) {
ASSERT_EQ(0, pthread_join(thread, nullptr)); pthread_t thread;
ASSERT_EQ(0, pthread_create(&thread, nullptr, [](void*) -> void* { return nullptr; }, nullptr));
ASSERT_EQ(0, pthread_join(thread, nullptr));
}
// A native bridge implementation might need a warm up pass to reach a steady state.
// http://b/37920774.
if (pass == 0) lc.Reset();
} }
} }
@ -145,9 +152,8 @@ TEST(pthread_leak, detach) {
WaitUntilAllExited(tids, arraysize(tids)); WaitUntilAllExited(tids, arraysize(tids));
// houdini keeps a thread pool, so we ignore the first pass while the // A native bridge implementation might need a warm up pass to reach a steady state.
// pool fills, but then on the second pass require that the "pool" isn't // http://b/37920774.
// actually an unbounded leak. https://issuetracker.google.com/37920774.
if (pass == 0) lc.Reset(); if (pass == 0) lc.Reset();
} }
} }