mdbx: minor fix debug-output for mdbx_thread_key_create().

Change-Id: I718130cf2385b6221187cbcdeedd9d48d05289bb
This commit is contained in:
Leo Yuriev 2018-04-03 20:04:10 +03:00
parent f08c7ccac0
commit 797ae9d1db

View File

@ -210,13 +210,15 @@ static __cold void mdbx_rthc_unlock(void) {
}
static __inline int mdbx_thread_key_create(mdbx_thread_key_t *key) {
int rc;
#if defined(_WIN32) || defined(_WIN64)
*key = TlsAlloc();
return (*key != TLS_OUT_OF_INDEXES) ? MDBX_SUCCESS : GetLastError();
rc = (*key != TLS_OUT_OF_INDEXES) ? MDBX_SUCCESS : GetLastError();
#else
return pthread_key_create(key, nullptr);
rc = pthread_key_create(key, nullptr);
#endif
mdbx_trace("&key = %p, value 0x%x", key, (unsigned)*key);
mdbx_trace("&key = %p, value 0x%x, rc %d", key, (unsigned)*key, rc);
return rc;
}
static __inline void mdbx_thread_key_delete(mdbx_thread_key_t key) {