allow custom thread id, upstream of python/cpython#115488)

This commit is contained in:
Daan 2024-05-18 17:05:13 -07:00
parent 381da05d8a
commit 66052f135f

View File

@ -222,7 +222,13 @@ extern bool _mi_process_is_initialized; // has mi_process_init been
static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept;
// Get a unique id for the current thread.
#if defined(_WIN32)
#if defined(MI_PRIM_THREAD_ID)
static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept {
return MI_PRIM_THREAD_ID(); // used for example by CPython for a free threaded build (see python/cpython#115488)
}
#elif defined(_WIN32)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN