Admit that we don't actually support thread priority inheritance.

Bug: https://code.google.com/p/android/issues/detail?id=218323
Change-Id: I6c69b0fbb8414e7cc2deeb8be50b6af4830ed55e
This commit is contained in:
Elliott Hughes 2016-07-27 14:05:10 -07:00
parent 931be5a64d
commit 7292725bcd
2 changed files with 55 additions and 55 deletions

View File

@ -95,8 +95,8 @@
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
#define _POSIX_THREAD_KEYS_MAX 128 #define _POSIX_THREAD_KEYS_MAX 128
#define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L #define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L
#define _POSIX_THREAD_PRIO_INHERIT 200809L /* linux feature */ #define _POSIX_THREAD_PRIO_INHERIT -1 /* not implemented */
#define _POSIX_THREAD_PRIO_PROTECT 200809L /* linux feature */ #define _POSIX_THREAD_PRIO_PROTECT -1 /* not implemented */
#define _POSIX_THREAD_PROCESS_SHARED -1 /* not implemented */ #define _POSIX_THREAD_PROCESS_SHARED -1 /* not implemented */
#define _POSIX_THREAD_ROBUST_PRIO_INHERIT -1 /* not implemented */ #define _POSIX_THREAD_ROBUST_PRIO_INHERIT -1 /* not implemented */
#define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1 /* not implemented */ #define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1 /* not implemented */

View File

@ -609,8 +609,8 @@ TEST(UNISTD_TEST, _POSIX_macros_smoke) {
EXPECT_GT(_POSIX_THREAD_DESTRUCTOR_ITERATIONS, 0); EXPECT_GT(_POSIX_THREAD_DESTRUCTOR_ITERATIONS, 0);
EXPECT_EQ(_POSIX_THREAD_KEYS_MAX, 128); EXPECT_EQ(_POSIX_THREAD_KEYS_MAX, 128);
EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_PRIORITY_SCHEDULING); EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_PRIORITY_SCHEDULING);
EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_PRIO_INHERIT); EXPECT_EQ(-1, _POSIX_THREAD_PRIO_INHERIT);
EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_PRIO_PROTECT); EXPECT_EQ(-1, _POSIX_THREAD_PRIO_PROTECT);
EXPECT_EQ(-1, _POSIX_THREAD_ROBUST_PRIO_PROTECT); EXPECT_EQ(-1, _POSIX_THREAD_ROBUST_PRIO_PROTECT);
EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_SAFE_FUNCTIONS); EXPECT_EQ(_POSIX_VERSION, _POSIX_THREAD_SAFE_FUNCTIONS);
EXPECT_EQ(-1, _POSIX_THREAD_SPORADIC_SERVER); EXPECT_EQ(-1, _POSIX_THREAD_SPORADIC_SERVER);
@ -672,7 +672,7 @@ TEST(UNISTD_TEST, _POSIX_macros_smoke) {
#endif // defined(__BIONIC__) #endif // defined(__BIONIC__)
} }
#define VERIFY_SYSCONF_NOT_SUPPORT(name) VerifySysconf(name, #name, [](long v){return v == -1;}) #define VERIFY_SYSCONF_UNSUPPORTED(name) VerifySysconf(name, #name, [](long v){return v == -1;})
// sysconf() means unlimited when it returns -1 with errno unchanged. // sysconf() means unlimited when it returns -1 with errno unchanged.
#define VERIFY_SYSCONF_POSITIVE(name) \ #define VERIFY_SYSCONF_POSITIVE(name) \
@ -704,9 +704,9 @@ TEST(UNISTD_TEST, sysconf) {
VERIFY_SYSCONF_POSITIVE(_SC_OPEN_MAX); VERIFY_SYSCONF_POSITIVE(_SC_OPEN_MAX);
VERIFY_SYSCONF_POSITIVE(_SC_PASS_MAX); VERIFY_SYSCONF_POSITIVE(_SC_PASS_MAX);
VERIFY_SYSCONF_POSIX_VERSION(_SC_2_C_BIND); VERIFY_SYSCONF_POSIX_VERSION(_SC_2_C_BIND);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_FORT_DEV); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_FORT_DEV);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_FORT_RUN); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_FORT_RUN);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_UPE); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_UPE);
VERIFY_SYSCONF_POSITIVE(_SC_JOB_CONTROL); VERIFY_SYSCONF_POSITIVE(_SC_JOB_CONTROL);
VERIFY_SYSCONF_POSITIVE(_SC_SAVED_IDS); VERIFY_SYSCONF_POSITIVE(_SC_SAVED_IDS);
VERIFY_SYSCONF_POSIX_VERSION(_SC_VERSION); VERIFY_SYSCONF_POSIX_VERSION(_SC_VERSION);
@ -753,20 +753,20 @@ TEST(UNISTD_TEST, sysconf) {
VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_ATTR_STACKADDR); VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_ATTR_STACKADDR);
VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_ATTR_STACKSIZE); VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_ATTR_STACKSIZE);
VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_PRIORITY_SCHEDULING); VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_PRIORITY_SCHEDULING);
VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_PRIO_INHERIT); VERIFY_SYSCONF_UNSUPPORTED(_SC_THREAD_PRIO_INHERIT);
VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_PRIO_PROTECT); VERIFY_SYSCONF_UNSUPPORTED(_SC_THREAD_PRIO_PROTECT);
VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_SAFE_FUNCTIONS); VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_SAFE_FUNCTIONS);
VERIFY_SYSCONF_POSITIVE(_SC_NPROCESSORS_CONF); VERIFY_SYSCONF_POSITIVE(_SC_NPROCESSORS_CONF);
VERIFY_SYSCONF_POSITIVE(_SC_NPROCESSORS_ONLN); VERIFY_SYSCONF_POSITIVE(_SC_NPROCESSORS_ONLN);
VERIFY_SYSCONF_POSITIVE(_SC_PHYS_PAGES); VERIFY_SYSCONF_POSITIVE(_SC_PHYS_PAGES);
VERIFY_SYSCONF_POSITIVE(_SC_AVPHYS_PAGES); VERIFY_SYSCONF_POSITIVE(_SC_AVPHYS_PAGES);
VERIFY_SYSCONF_POSIX_VERSION(_SC_MONOTONIC_CLOCK); VERIFY_SYSCONF_POSIX_VERSION(_SC_MONOTONIC_CLOCK);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_PBS);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS_ACCOUNTING); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_PBS_ACCOUNTING);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS_CHECKPOINT); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_PBS_CHECKPOINT);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS_LOCATE); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_PBS_LOCATE);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS_MESSAGE); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_PBS_MESSAGE);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_PBS_TRACK); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_PBS_TRACK);
VERIFY_SYSCONF_POSIX_VERSION(_SC_CLOCK_SELECTION); VERIFY_SYSCONF_POSIX_VERSION(_SC_CLOCK_SELECTION);
VERIFY_SYSCONF_POSITIVE(_SC_HOST_NAME_MAX); VERIFY_SYSCONF_POSITIVE(_SC_HOST_NAME_MAX);
VERIFY_SYSCONF_POSIX_VERSION(_SC_IPV6); VERIFY_SYSCONF_POSIX_VERSION(_SC_IPV6);
@ -774,64 +774,64 @@ TEST(UNISTD_TEST, sysconf) {
VERIFY_SYSCONF_POSIX_VERSION(_SC_READER_WRITER_LOCKS); VERIFY_SYSCONF_POSIX_VERSION(_SC_READER_WRITER_LOCKS);
VERIFY_SYSCONF_POSITIVE(_SC_REGEXP); VERIFY_SYSCONF_POSITIVE(_SC_REGEXP);
VERIFY_SYSCONF_POSITIVE(_SC_SHELL); VERIFY_SYSCONF_POSITIVE(_SC_SHELL);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_SPORADIC_SERVER); VERIFY_SYSCONF_UNSUPPORTED(_SC_SPORADIC_SERVER);
VERIFY_SYSCONF_POSITIVE(_SC_SYMLOOP_MAX); VERIFY_SYSCONF_POSITIVE(_SC_SYMLOOP_MAX);
VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_CPUTIME); VERIFY_SYSCONF_POSIX_VERSION(_SC_THREAD_CPUTIME);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_THREAD_SPORADIC_SERVER); VERIFY_SYSCONF_UNSUPPORTED(_SC_THREAD_SPORADIC_SERVER);
VERIFY_SYSCONF_POSIX_VERSION(_SC_TIMEOUTS); VERIFY_SYSCONF_POSIX_VERSION(_SC_TIMEOUTS);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE); VERIFY_SYSCONF_UNSUPPORTED(_SC_TRACE);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_EVENT_FILTER); VERIFY_SYSCONF_UNSUPPORTED(_SC_TRACE_EVENT_FILTER);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_EVENT_NAME_MAX); VERIFY_SYSCONF_UNSUPPORTED(_SC_TRACE_EVENT_NAME_MAX);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_INHERIT); VERIFY_SYSCONF_UNSUPPORTED(_SC_TRACE_INHERIT);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_LOG); VERIFY_SYSCONF_UNSUPPORTED(_SC_TRACE_LOG);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_NAME_MAX); VERIFY_SYSCONF_UNSUPPORTED(_SC_TRACE_NAME_MAX);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_SYS_MAX); VERIFY_SYSCONF_UNSUPPORTED(_SC_TRACE_SYS_MAX);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_TRACE_USER_EVENT_MAX); VERIFY_SYSCONF_UNSUPPORTED(_SC_TRACE_USER_EVENT_MAX);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_TYPED_MEMORY_OBJECTS); VERIFY_SYSCONF_UNSUPPORTED(_SC_TYPED_MEMORY_OBJECTS);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_STREAMS); VERIFY_SYSCONF_UNSUPPORTED(_SC_XOPEN_STREAMS);
#if defined(__LP64__) #if defined(__LP64__)
VERIFY_SYSCONF_NOT_SUPPORT(_SC_V7_ILP32_OFF32); VERIFY_SYSCONF_UNSUPPORTED(_SC_V7_ILP32_OFF32);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_V7_ILP32_OFFBIG); VERIFY_SYSCONF_UNSUPPORTED(_SC_V7_ILP32_OFFBIG);
VERIFY_SYSCONF_POSITIVE(_SC_V7_LP64_OFF64); VERIFY_SYSCONF_POSITIVE(_SC_V7_LP64_OFF64);
VERIFY_SYSCONF_POSITIVE(_SC_V7_LPBIG_OFFBIG); VERIFY_SYSCONF_POSITIVE(_SC_V7_LPBIG_OFFBIG);
#else #else
VERIFY_SYSCONF_POSITIVE(_SC_V7_ILP32_OFF32); VERIFY_SYSCONF_POSITIVE(_SC_V7_ILP32_OFF32);
#if defined(__BIONIC__) #if defined(__BIONIC__)
// bionic does not support 64 bits off_t type on 32bit machine. // bionic does not support 64 bits off_t type on 32bit machine.
VERIFY_SYSCONF_NOT_SUPPORT(_SC_V7_ILP32_OFFBIG); VERIFY_SYSCONF_UNSUPPORTED(_SC_V7_ILP32_OFFBIG);
#endif #endif
VERIFY_SYSCONF_NOT_SUPPORT(_SC_V7_LP64_OFF64); VERIFY_SYSCONF_UNSUPPORTED(_SC_V7_LP64_OFF64);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_V7_LPBIG_OFFBIG); VERIFY_SYSCONF_UNSUPPORTED(_SC_V7_LPBIG_OFFBIG);
#endif #endif
#if defined(__BIONIC__) #if defined(__BIONIC__)
// Tests can only run on bionic, as bionic and glibc have different support for these options. // Tests can only run on bionic, as bionic and glibc have different support for these options.
// Below options are not supported on bionic yet. // Below options are not supported on bionic yet.
VERIFY_SYSCONF_NOT_SUPPORT(_SC_ASYNCHRONOUS_IO); VERIFY_SYSCONF_UNSUPPORTED(_SC_ASYNCHRONOUS_IO);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_BARRIERS); VERIFY_SYSCONF_UNSUPPORTED(_SC_BARRIERS);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_MESSAGE_PASSING); VERIFY_SYSCONF_UNSUPPORTED(_SC_MESSAGE_PASSING);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_PRIORITIZED_IO); VERIFY_SYSCONF_UNSUPPORTED(_SC_PRIORITIZED_IO);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_SHARED_MEMORY_OBJECTS); VERIFY_SYSCONF_UNSUPPORTED(_SC_SHARED_MEMORY_OBJECTS);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_SPAWN); VERIFY_SYSCONF_UNSUPPORTED(_SC_SPAWN);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_SPIN_LOCKS); VERIFY_SYSCONF_UNSUPPORTED(_SC_SPIN_LOCKS);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_THREAD_PROCESS_SHARED); VERIFY_SYSCONF_UNSUPPORTED(_SC_THREAD_PROCESS_SHARED);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_THREAD_ROBUST_PRIO_INHERIT); VERIFY_SYSCONF_UNSUPPORTED(_SC_THREAD_ROBUST_PRIO_INHERIT);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_THREAD_ROBUST_PRIO_PROTECT); VERIFY_SYSCONF_UNSUPPORTED(_SC_THREAD_ROBUST_PRIO_PROTECT);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_C_DEV); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_C_DEV);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_CHAR_TERM); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_CHAR_TERM);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_LOCALEDEF); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_LOCALEDEF);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_SW_DEV); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_SW_DEV);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_2_VERSION); VERIFY_SYSCONF_UNSUPPORTED(_SC_2_VERSION);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_CRYPT); VERIFY_SYSCONF_UNSUPPORTED(_SC_XOPEN_CRYPT);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_ENH_I18N); VERIFY_SYSCONF_UNSUPPORTED(_SC_XOPEN_ENH_I18N);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_LEGACY); VERIFY_SYSCONF_UNSUPPORTED(_SC_XOPEN_LEGACY);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_REALTIME); VERIFY_SYSCONF_UNSUPPORTED(_SC_XOPEN_REALTIME);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_REALTIME_THREADS); VERIFY_SYSCONF_UNSUPPORTED(_SC_XOPEN_REALTIME_THREADS);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_SHM); VERIFY_SYSCONF_UNSUPPORTED(_SC_XOPEN_SHM);
VERIFY_SYSCONF_NOT_SUPPORT(_SC_XOPEN_UUCP); VERIFY_SYSCONF_UNSUPPORTED(_SC_XOPEN_UUCP);
#endif // defined(__BIONIC__) #endif // defined(__BIONIC__)
} }