Use fallback ThreadImpl for mingw#1351
Conversation
|
Could we use c++ casts instead of the old c style ones? Also, is there some sort of mingw define to put these changes behind? The msvc stl returns a |
Hm, that makes me think maybe I'll need to look into this more properly to make sure this fix is correct. Perhaps the actual problem is that the native handle on mingw is a pthread handle, in which case the cast is not a sufficient fix. |
|
From a quick google it seems mingw provides two threading implementations, a posix one (the default) and a win32 one, but only the posix one provides a C++11 threading implementation. There are some third party projects which provides C++11 threading support for the win32 implementation though. https://github.com/meganz/mingw-std-threads So it does seem like this change just silences the warning but it won't actually work as it's just casting a pthread handle to a win32 HANDLE. This has done nothing to change my opinion that mingw and it's ilk are a massive nightmare and not worth it. |
Mingw has a pthread handle as the native thread, so we cannot use it with the win32 api.
This is msvc specific, so it should only be added for msvc builds, not globally in the haxe-target.xml file. It is already added for msvc builds in the msvc-toolchain file.
d6ed39a to
3a60b4d
Compare
|
I made it fall back to the noop implementation on mingw which seems like the easiest fix, given that this feature is not fully supported anyway. I've also removed the |
|
Thanks! |
Possibly a regression from: #1336.
Mingw is has a pthread handle as
std::thread::native_handle_typeso it cannot be used in APIs that expectHANDLE: