在 2022-11-07 12:37, Andrew Pinski 写道: > > The original code which used pthread was added in GCC 5 way before GCC > moved to being written in C++11 which was only in the last 3 years. > pthread_* functions were the best choice at the time (2014) but now > GCC is written in C++11, I don't see any reason not to move them over > to using C++11 threading code. > > Attached is the proposed patch. The win32 thread model does not have `std::mutex`; but there is no `pthread_mutex_t` either, so it does not build either way. Tested bootstrapping GCC on `{i686,x86_64}-w64-mingw32` with languages `c,lto,c++,fortran,objc,obj-c++` and with the `mcf` thread model; no errors observed. The built `libgccjit-0.dll` does not have imports from winpthread any more. Please review. -- Best regards, LIU Hao