public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Ramiro Polla <ramiro@lisha.ufsc.br>
To: pthreads-win32@sourceware.org
Subject: Static libraries initialization
Date: Thu, 24 Apr 2008 12:53:00 -0000	[thread overview]
Message-ID: <481082AE.3030904@lisha.ufsc.br> (raw)

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

             reply	other threads:[~2008-04-24 12:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24 12:53 Ramiro Polla [this message]
     [not found] ` <4810ABB9.10106@homemail.com.au>
     [not found]   ` <4810D5C3.2070306@lisha.ufsc.br>
2008-04-25  5:01     ` Ross Johnson
2008-04-26  0:07       ` Ross Johnson
2008-05-19 11:29       ` Roland Schwarz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=481082AE.3030904@lisha.ufsc.br \
    --to=ramiro@lisha.ufsc.br \
    --cc=pthreads-win32@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).