Fix pthread.pthread_attr_setinheritsched__PTHREAD_INHERIT_SCHED__PTHREAD_EXPLICIT_SCHED for LP32.
LP32 continues to ignore failures to set scheduler attributes for
backwards compatibility with pre-Honeycomb bugs :-(
Bug: http://b/68486614
Test: ran tests (32-bit and 64-bit!)
Change-Id: I18a012cdf2f3c5bb63a5367bca2bac2de7f53ae2
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index fb2a679..5eef35a 100755
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -2210,9 +2210,14 @@
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) {