mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:34:13 +08:00
mdbx-windows: handling EXCEPTION_POSSIBLE_DEADLOCK
.
Change-Id: If42c7833e9c4e02fef25634e69c0bd2e926686c1
This commit is contained in:
parent
092ab094c4
commit
2dab009e76
1
.github/actions/spelling/expect.txt
vendored
1
.github/actions/spelling/expect.txt
vendored
@ -447,6 +447,7 @@ EWOULDBLOCK
|
|||||||
Exa
|
Exa
|
||||||
exactkey
|
exactkey
|
||||||
exactp
|
exactp
|
||||||
|
excpt
|
||||||
exe
|
exe
|
||||||
exename
|
exename
|
||||||
exherbo
|
exherbo
|
||||||
|
@ -58,6 +58,7 @@ Fixes:
|
|||||||
- Fixed large pages checking (for compatibility and to avoid false-positive errors from `mdbx_chk`).
|
- Fixed large pages checking (for compatibility and to avoid false-positive errors from `mdbx_chk`).
|
||||||
- Added workaround for Wine (https://github.com/miranda-ng/miranda-ng/issues/1209).
|
- Added workaround for Wine (https://github.com/miranda-ng/miranda-ng/issues/1209).
|
||||||
- Fixed `ERROR_NOT_SUPPORTED` while opening DB by UNC pathnames (https://github.com/miranda-ng/miranda-ng/issues/2627).
|
- Fixed `ERROR_NOT_SUPPORTED` while opening DB by UNC pathnames (https://github.com/miranda-ng/miranda-ng/issues/2627).
|
||||||
|
- Added handling `EXCEPTION_POSSIBLE_DEADLOCK` condition for Windows.
|
||||||
|
|
||||||
|
|
||||||
## v0.9.1 2020-09-30
|
## v0.9.1 2020-09-30
|
||||||
|
@ -144,8 +144,16 @@ int mdbx_txn_lock(MDBX_env *env, bool dontwait) {
|
|||||||
if (!TryEnterCriticalSection(&env->me_windowsbug_lock))
|
if (!TryEnterCriticalSection(&env->me_windowsbug_lock))
|
||||||
return MDBX_BUSY;
|
return MDBX_BUSY;
|
||||||
} else {
|
} else {
|
||||||
|
__try {
|
||||||
EnterCriticalSection(&env->me_windowsbug_lock);
|
EnterCriticalSection(&env->me_windowsbug_lock);
|
||||||
}
|
}
|
||||||
|
__except ((GetExceptionCode() ==
|
||||||
|
0xC0000194 /* STATUS_POSSIBLE_DEADLOCK / EXCEPTION_POSSIBLE_DEADLOCK */)
|
||||||
|
? EXCEPTION_EXECUTE_HANDLER
|
||||||
|
: EXCEPTION_CONTINUE_SEARCH) {
|
||||||
|
return ERROR_POSSIBLE_DEADLOCK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((env->me_flags & MDBX_EXCLUSIVE) ||
|
if ((env->me_flags & MDBX_EXCLUSIVE) ||
|
||||||
flock(env->me_lazy_fd,
|
flock(env->me_lazy_fd,
|
||||||
|
@ -1242,3 +1242,5 @@ wcsstr
|
|||||||
wcstol
|
wcstol
|
||||||
wcstombs
|
wcstombs
|
||||||
wcstoul
|
wcstoul
|
||||||
|
__C_specific_handler
|
||||||
|
_except_handler4_common
|
||||||
|
@ -492,7 +492,15 @@ MDBX_INTERNAL_FUNC int mdbx_fastmutex_destroy(mdbx_fastmutex_t *fastmutex) {
|
|||||||
|
|
||||||
MDBX_INTERNAL_FUNC int mdbx_fastmutex_acquire(mdbx_fastmutex_t *fastmutex) {
|
MDBX_INTERNAL_FUNC int mdbx_fastmutex_acquire(mdbx_fastmutex_t *fastmutex) {
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
|
__try {
|
||||||
EnterCriticalSection(fastmutex);
|
EnterCriticalSection(fastmutex);
|
||||||
|
} __except (
|
||||||
|
(GetExceptionCode() ==
|
||||||
|
0xC0000194 /* STATUS_POSSIBLE_DEADLOCK / EXCEPTION_POSSIBLE_DEADLOCK */)
|
||||||
|
? EXCEPTION_EXECUTE_HANDLER
|
||||||
|
: EXCEPTION_CONTINUE_SEARCH) {
|
||||||
|
return ERROR_POSSIBLE_DEADLOCK;
|
||||||
|
}
|
||||||
return MDBX_SUCCESS;
|
return MDBX_SUCCESS;
|
||||||
#else
|
#else
|
||||||
return pthread_mutex_lock(fastmutex);
|
return pthread_mutex_lock(fastmutex);
|
||||||
|
@ -146,6 +146,7 @@ __extern_C key_t ftok(const char *, int);
|
|||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
|
#include <excpt.h>
|
||||||
#include <tlhelp32.h>
|
#include <tlhelp32.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winnt.h>
|
#include <winnt.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user