mdbx: добавление кода системной ошибки MDBX_EDEADLK.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2023-11-03 14:11:58 +03:00
parent 4b79d46d38
commit 796e56b9b9
3 changed files with 6 additions and 4 deletions

6
mdbx.h
View File

@ -1950,7 +1950,8 @@ enum MDBX_error_t {
MDBX_EPERM = ERROR_INVALID_FUNCTION, MDBX_EPERM = ERROR_INVALID_FUNCTION,
MDBX_EINTR = ERROR_CANCELLED, MDBX_EINTR = ERROR_CANCELLED,
MDBX_ENOFILE = ERROR_FILE_NOT_FOUND, MDBX_ENOFILE = ERROR_FILE_NOT_FOUND,
MDBX_EREMOTE = ERROR_REMOTE_STORAGE_MEDIA_ERROR MDBX_EREMOTE = ERROR_REMOTE_STORAGE_MEDIA_ERROR,
MDBX_EDEADLK = ERROR_POSSIBLE_DEADLOCK
#else /* Windows */ #else /* Windows */
#ifdef ENODATA #ifdef ENODATA
MDBX_ENODATA = ENODATA, MDBX_ENODATA = ENODATA,
@ -1966,7 +1967,8 @@ enum MDBX_error_t {
MDBX_EPERM = EPERM, MDBX_EPERM = EPERM,
MDBX_EINTR = EINTR, MDBX_EINTR = EINTR,
MDBX_ENOFILE = ENOENT, MDBX_ENOFILE = ENOENT,
MDBX_EREMOTE = ENOTBLK MDBX_EREMOTE = ENOTBLK,
MDBX_EDEADLK = EDEADLK
#endif /* !Windows */ #endif /* !Windows */
}; };
#ifndef __cplusplus #ifndef __cplusplus

View File

@ -190,7 +190,7 @@ int osal_txn_lock(MDBX_env *env, bool dontwait) {
0xC0000194 /* STATUS_POSSIBLE_DEADLOCK / EXCEPTION_POSSIBLE_DEADLOCK */) 0xC0000194 /* STATUS_POSSIBLE_DEADLOCK / EXCEPTION_POSSIBLE_DEADLOCK */)
? EXCEPTION_EXECUTE_HANDLER ? EXCEPTION_EXECUTE_HANDLER
: EXCEPTION_CONTINUE_SEARCH) { : EXCEPTION_CONTINUE_SEARCH) {
return ERROR_POSSIBLE_DEADLOCK; return MDBX_EDEADLK;
} }
} }

View File

@ -536,7 +536,7 @@ MDBX_INTERNAL_FUNC int osal_fastmutex_acquire(osal_fastmutex_t *fastmutex) {
0xC0000194 /* STATUS_POSSIBLE_DEADLOCK / EXCEPTION_POSSIBLE_DEADLOCK */) 0xC0000194 /* STATUS_POSSIBLE_DEADLOCK / EXCEPTION_POSSIBLE_DEADLOCK */)
? EXCEPTION_EXECUTE_HANDLER ? EXCEPTION_EXECUTE_HANDLER
: EXCEPTION_CONTINUE_SEARCH) { : EXCEPTION_CONTINUE_SEARCH) {
return ERROR_POSSIBLE_DEADLOCK; return MDBX_EDEADLK;
} }
return MDBX_SUCCESS; return MDBX_SUCCESS;
#else #else