fix-mono-android-pthread_mutexattr_setprotocol.diff 631 B

12345678910111213
  1. diff --git a/mono/utils/mono-os-mutex.h b/mono/utils/mono-os-mutex.h
  2. index e8039bf4094..ee39c0330b3 100644
  3. --- a/mono/utils/mono-os-mutex.h
  4. +++ b/mono/utils/mono-os-mutex.h
  5. @@ -57,7 +57,7 @@ mono_os_mutex_init_type (mono_mutex_t *mutex, int type)
  6. if (G_UNLIKELY (res != 0))
  7. g_error ("%s: pthread_mutexattr_settype failed with \"%s\" (%d)", __func__, g_strerror (res), res);
  8. -#ifdef PTHREAD_PRIO_INHERIT
  9. +#if defined(PTHREAD_PRIO_INHERIT) && __ANDROID_API__ >= 28
  10. /* use PTHREAD_PRIO_INHERIT if possible */
  11. res = pthread_mutexattr_setprotocol (&attr, PTHREAD_PRIO_INHERIT);
  12. if (G_UNLIKELY (res != 0 && res != ENOTSUP))