#include <pthread.h>
#include <pthreadP.h>
#include <stap-probe.h>
+#include <elide.h>
/* Acquire read lock for RWLOCK. Slow path. */
LIBC_PROBE (rdlock_entry, 1, rwlock);
+ if (ELIDE_LOCK (rwlock->__data.__rwelision,
+ rwlock->__data.__lock == 0
+ && rwlock->__data.__writer == 0
+ && rwlock->__data.__nr_readers == 0))
+ return 0;
+
/* Make sure we are alone. */
lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);