mdbx: fix pthread_yield() for non-GLIBC.

Change-Id: I080e37a42b62e524896dea8747e9f23e2fcd584f
This commit is contained in:
Leonid Yuriev 2020-10-06 00:28:12 +03:00
parent 787eaaa373
commit fe65c122d2
2 changed files with 4 additions and 1 deletions

View File

@ -777,7 +777,9 @@ static __always_inline void atomic_yield(void) {
defined(__mips64__) || defined(_M_MRX000) || defined(_MIPS_) || \
defined(__MWERKS__) || defined(__sgi)
__asm__ __volatile__(".word 0x00000140");
#else
#elif defined(__linux__) || defined(__gnu_linux__) || defined(_UNIX03_SOURCE)
sched_yield();
#elif (defined(_GNU_SOURCE) && __GLIBC_PREREQ(2, 1)) || defined(_OPEN_THREADS)
pthread_yield();
#endif
}

View File

@ -119,6 +119,7 @@
#if defined(__linux__) || defined(__gnu_linux__)
#include <linux/sysctl.h>
#include <sched.h>
#include <sys/sendfile.h>
#include <sys/statfs.h>
#endif /* Linux */