On Thu, 10 Oct 2024, Jacek Caban wrote:

On 10.10.2024 13:15, Martin Storsjö wrote:
On Thu, 10 Oct 2024, Julian Waters wrote:

That said - for a non-pthreads thread model GCC, or with Clang, one has to manually link against winpthread to practically use nanosleep() or clock_gettime(), as that's not linked implicitly except for when GCC uses it for the libgcc thread model.

One may wonder why those functions are in winpthread at all, rather than in e.g. libmingwex like many other compatibility additions we have. I think there may be some interaction with other pthread facilities though... Not sure if this is a direction worth going into, or if it just changes things that already have got an established way of working.


FWIW, I've never been a fun of how winpthread is interacting with mingw-w64-headers and something like that could potentially get rid of this weird dependency (I assume that we'd then move pthread_* headers to mingw-w64-headers too). nanosleep seems to depend on winpthread internals, but maybe we could have a simpler implementation in crt and winpthread could override it if it really needs to. I'm not sure, the current solution seems to work well in practice after all.

Yeah, (as discussed on irc with Liu Hao), the current situation is complex enough (and the current behaviour is somewhat entrenched), and unless we have a concrete problem we're trying to resolve, I'd leave it as it is.

// Martin

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to