ALOCKED() if available.
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2418
d4fa192b-c00b-0410-8231-
f00ffab90ce4
#include <sys/socket.h>
#include <pthread.h>
+#ifdef HAVE_PTHREAD_NP_H
+#include <pthread_np.h>
+#endif
#include <stdint.h>
#include "vqueue.h"
} while (0);
#endif
-#ifdef DIAGNOSTICS
-#define ALOCKED(foo) AN(pthread_mutex_trylock(foo))
+#if defined(HAVE_PTHREAD_MUTEX_ISLOCKED_NP)
+#define ALOCKED(mutex) AN(pthread_mutex_islocked_np((mutex)))
+#elif defined(DIAGNOSTICS)
+#define ALOCKED(mutex) AN(pthread_mutex_trylock((mutex)))
#else
-#define ALOCKED(foo) (void)(foo)
+#define ALOCKED(mutex) (void)(mutex)
#endif
/*
* Name threads if our pthreads implementation supports it.
*/
-#ifdef HAVE_PTHREAD_NP_H
-#include <pthread_np.h>
-#endif
-
void
THR_Name(const char *name)
{