mdbx: add MDBX_txn.mt_owner and MDBX_THREAD_MISMATCH.

This commit is contained in:
Leo Yuriev
2017-06-06 17:05:30 +03:00
parent 3bf3a08f96
commit 465459dc58
6 changed files with 104 additions and 16 deletions

View File

@@ -439,7 +439,6 @@ int mdbx_thread_create(mdbx_thread_t *thread,
THREAD_RESULT(THREAD_CALL *start_routine)(void *),
void *arg);
int mdbx_thread_join(mdbx_thread_t thread);
mdbx_tid_t mdbx_thread_self(void);
int mdbx_thread_key_create(mdbx_thread_key_t *key);
void mdbx_thread_key_delete(mdbx_thread_key_t key);
void *mdbx_thread_rthc_get(mdbx_thread_key_t key);
@@ -465,6 +464,14 @@ static __inline mdbx_pid_t mdbx_getpid(void) {
#endif
}
static __inline mdbx_tid_t mdbx_thread_self(void) {
#if defined(_WIN32) || defined(_WIN64)
return GetCurrentThreadId();
#else
return pthread_self();
#endif
}
void mdbx_osal_jitter(bool tiny);
/*----------------------------------------------------------------------------*/