- Add OpenBSD to syscall compatibility header as appropriate.
- Add function for retrieving the thread id in urcu_get_thread_id().
- Rely on pthread cond variables for futex compatibility.
It builds on all of our archs and fully run time tested on amd64.
Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I5cca5962ba3dc3113c9bd12e544b6e6f77dfdb61
#include <syscall.h>
#elif defined(__CYGWIN__) || defined(__APPLE__) || \
- defined(__FreeBSD__) || defined(__DragonFly__)
+ defined(__FreeBSD__) || defined(__DragonFly__) || \
+ defined(__OpenBSD__)
/* Don't include anything on these platforms. */
#else
pthread_t thr = pthread_self();
return pthread_getsequence_np(&thr);
}
+#elif defined(__OpenBSD__)
+#include <unistd.h>
+static inline
+unsigned long urcu_get_thread_id(void)
+{
+ return (unsigned long) getthrid();
+}
#else
# warning "use pid as thread ID"
static inline