The implementation design respects the fact that Eina_Thread is an
uintptr_t. This means we need to allocate the thread struct in the heap
and return the pointer. This creates a complication for eina_thread_self,
as the returned Eina_Thread is not supposed to be explicitly freed (like
the posix implementation counterpart).
To solve this problem, we store the created thread structure in the
target thread TLS slot. For threads that were not created through eina
API, in eina_thread_self we allocate a new structure, push it to the TLS
slot and mark it to be freed on thread exit.
Notice we prefer _beginthreadex over CreateThread. _beginthreadex,
besides creating a new thread, ensures the C runtime will work on a
A new variable is introduced in the meson builds, called
sys_native_windows, that is true when we are compiling for Windows
outside mingw or cygwin. We check it by looking at the compiler we are
using. If it is Microsoft Visual C++ or clang-cl, we assume it is a native
Windows compilation linking directly to the Microsoft runtime libraries.