From: James S. <jam...@op...> - 2007-02-14 05:10:29
|
On Tue, 2007-02-13 at 19:43 -0800, Brian Dessent wrote: > Brian Dessent wrote: > > > You should ask on the apr list. But it sounds like apr's configury is > > not doing the right thing on MinGW if it has enabled threads but not > > added -mthreads to CFLAGS. > > ...and in the meantime you should add -mthreads to CFLAGS yourself (e.g. > ./configure CFLAGS="-g -O2 -mthreads") when building libapr and when > building your project. All objects used in a multithreaded app should > be compiled with -mthreads, not just parts. The option does more than > just link to mingwm10.dll, it also #defines _MT which is used elsewhere > in the headers. If your app is multithreaded and has been built thus > far without -mthreads then it's luck that you haven't noticed any > problems. This is like depending on undefined behavior, it may work > fine for years or it may blow up in flames. This is for C++ apps only, isn't it? `-mthreads' Support thread-safe exception handling on `Mingw32'. Code that relies on thread-safe exception handling must compile and link all code with the `-mthreads' option. When compiling, `-mthreads' defines `-D_MT'; when linking, it links in a special thread helper library `-lmingwthrd' which cleans up per thread exception handling data. If a threaded app is written in C where there's no exception handling, it shouldn't be a problem, right? Cheers, James. |