mdbx: add mdbx_env_delete().

Resolves https://github.com/erthink/libmdbx/issues/119
Related to https://github.com/Kerollmops/heed/issues/58

Change-Id: Iec5bf5978e45bb6843f3ed8dd06ea4d34f2895cb
This commit is contained in:
Leonid Yuriev
2020-10-09 22:43:14 +03:00
parent cd0c727880
commit 0627d902dd
7 changed files with 162 additions and 1 deletions

View File

@@ -204,6 +204,15 @@ MDBX_INTERNAL_FUNC void mdbx_rdt_unlock(MDBX_env *env) {
mdbx_srwlock_ReleaseShared(&env->me_remap_guard);
}
MDBX_INTERNAL_FUNC int mdbx_lockfile(mdbx_filehandle_t fd, bool wait) {
return flock(fd,
wait ? LCK_EXCLUSIVE | LCK_WAITFOR
: LCK_EXCLUSIVE | LCK_DONTWAIT,
0, LCK_MAXLEN)
? MDBX_SUCCESS
: GetLastError();
}
static int suspend_and_append(mdbx_handle_array_t **array,
const DWORD ThreadId) {
const unsigned limit = (*array)->limit;