From: Tony T. <ton...@gm...> - 2013-08-15 07:40:56
|
On 15/08/2013, at 5:24 PM, Radu Rendec <rad...@mi...> wrote: > On Wed, 2013-08-14 at 15:25 -0400, Earnie Boyd wrote: >> No, I'm not sure why but the package creation copies the >> libpthreadGC.dll.a to libpthread.a. Probably because there are issues >> with controlling the threads using a static library. I have yet to >> try testing the static library to see if it functions. > > I'm new to mingw, but my guess is that the file is copied for -lpthread > to work as expected: -l<foo> causes the linker to search for lib<foo>.a > or lib<foo>.so (lib<foo>.dll in case of mingw). > > According to older posts, the only issue with the static version is that > you need to explicitly call an initialization function from your > program, or else the program will crash on the first call to > pthread_create(). I found this information here: > > http://mingw.5.n7.nabble.com/statically-linked-pthread-library-crashes-program-td17693.html > > However, that thread is almost 4 years old, and I haven't tested that > myself on newer versions, so I'm not sure if it still applies. Version 2.9.1 introduced an autostatic[1] feature that removed the need to call pthread_win32_process_attach_np() and pthread_win32_process_detach_np() explicitly in most cases. The next release[2] should complete this so it's no longer required at all. Cheers, Tony [1] http://sourceware.org/ml/pthreads-win32/2010/msg00006.html [2] http://www.sourceware.org/pthreads-win32/news.html |