mirror of
https://gitflic.ru/project/erthink/libmdbx.git
synced 2025-11-03 13:56:40 +00:00
mdbx: minor workaround for HarmonyOS's bug.
The libc from HarmonyOS SDK erroneously defines `EOWNERDEAD`, `_POSIX_THREAD_PROCESS_SHARED >= 200809` and `PTHREAD_MUTEX_ROBUST` but the same time doesn't provide `pthread_mutexattr_setrobust()` and `pthread_mutex_consistent()`. This commit add a minor workaround for such bug for successful building without explicitly defining `MDBX_LOCKING=2001`. Related to https://github.com/erthink/libmdbx/issues/285, https://github.com/vorot93/libmdbx-rs/issues/41, https://github.com/isar-community/isar-community/issues/28.
This commit is contained in:
parent
43c4503a77
commit
60d5ba9790
@ -303,7 +303,8 @@
|
||||
((defined(_POSIX_THREAD_ROBUST_PRIO_INHERIT) && _POSIX_THREAD_ROBUST_PRIO_INHERIT > 0) || \
|
||||
(defined(_POSIX_THREAD_ROBUST_PRIO_PROTECT) && _POSIX_THREAD_ROBUST_PRIO_PROTECT > 0) || \
|
||||
defined(PTHREAD_MUTEX_ROBUST) || defined(PTHREAD_MUTEX_ROBUST_NP)) && \
|
||||
(!defined(__GLIBC__) || __GLIBC_PREREQ(2, 10) /* troubles with Robust mutexes before 2.10 */)
|
||||
(!defined(__GLIBC__) || __GLIBC_PREREQ(2, 10) /* troubles with Robust mutexes before 2.10 */) && \
|
||||
!defined(__OHOS__) /* Harmony OS doesn't support robust mutexes at the end of 2025 */
|
||||
#define MDBX_LOCKING MDBX_LOCKING_POSIX2008
|
||||
#else
|
||||
#define MDBX_LOCKING MDBX_LOCKING_POSIX2001
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user