This is the mail archive of the pthreads-win32@sourceware.org mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Static libraries initialization


Hello,

pthreads-win32 requires programs that use the library statically to call some (de)initialization code, which would be the same code called by DllMain(). There are plenty of messages regarding this on the mailinglist.

This makes the library not very developer friendly. It causes code duplication for every program that wants to use the library statically, #ifdef mess and harder configuration checks.

1- Why isn't this initialization done by pthreads-win32 itself? All
   pthread_* functions could have an if(!initialized) {...} block before
   running any code that depends on it.
2- Static pthreads-win32 libraries should at least check if they were
   properly initialized before allowing pthread_* functions to run.
   Returning an error is far better than having the program crash.

Ramiro Polla


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]