pthread_mutexattr_t *pattr = NULL;
pthread_mutex_t *mutex;
gint status;
+#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+ pthread_mutexattr_t attr;
+#endif
mutex = malloc (sizeof (pthread_mutex_t));
if G_UNLIKELY (mutex == NULL)
g_thread_abort (errno, "malloc");
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
- {
- pthread_mutexattr_t attr;
- pthread_mutexattr_init (&attr);
- pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
- pattr = &attr;
- }
+ pthread_mutexattr_init (&attr);
+ pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
+ pattr = &attr;
#endif
if G_UNLIKELY ((status = pthread_mutex_init (mutex, pattr)) != 0)