Merge "Fix pthread.pthread_attr_setinheritsched__PTHREAD_INHERIT_SCHED__PTHREAD_EXPLICIT_SCHED for LP32."

This commit is contained in:
Elliott Hughes 2017-10-30 18:34:31 +00:00 committed by Gerrit Code Review
commit 82e6ad1242

View file

@ -2210,9 +2210,14 @@ TEST(pthread, pthread_attr_setinheritsched__PTHREAD_INHERIT_SCHED__PTHREAD_EXPLI
ASSERT_EQ(0, pthread_create(&t, &attr, IdFn, nullptr));
ASSERT_EQ(0, pthread_join(t, nullptr));
// If we ask to use them, though...
#if defined(__LP64__)
// If we ask to use them, though, we'll see a failure...
ASSERT_EQ(0, pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED));
ASSERT_EQ(EINVAL, pthread_create(&t, &attr, IdFn, nullptr));
#else
// For backwards compatibility with broken apps, we just ignore failures
// to set scheduler attributes on LP32.
#endif
}
TEST(pthread, pthread_attr_setinheritsched_PTHREAD_INHERIT_SCHED_takes_effect) {