[gnutls-devel] Automatic library initialization

Tim Ruehsen tim.ruehsen at gmx.de
Tue Nov 24 10:38:41 CET 2015

On Monday 23 November 2015 11:23:29 Nikos Mavrogiannopoulos wrote:
> On Mon, Nov 16, 2015 at 5:24 PM, Nikos Mavrogiannopoulos
> <nmav at gnutls.org> wrote:
> >> Brilliant idea. I'll use it for my projects... but other projects won't
> >> benefit immediately (they first have to know).
> > 
> > I'll then include it in 3.4.x and 3.3.x releases.
> It was included in the 3.4.x and 3.3.x releases, but this option must
> be used with extreme care. Even though you may know where in your
> application gnutls usage starts, you may not know whether some library
> that you use will use it. You may not know for example that getpwnam()
> will end up requiring to call gnutls in some setups. For that it
> should not be used lightly as you'll rediscover the bugs that the
> initialization to constructor was solving.

Thanks for pointing out (I wasn't aware of getpwnam pulling in gnutls).

As far as I can see, on (most ?) multi-threaded environments 
gnutls_global_init is thread-safe via GNUTLS_STATIC_MUTEX* !?

If a system offers multi-threading, it will also offer mutexes/locks that 
could/will be used by gnutls. What am I missing ?

Regards, Tim

More information about the Gnutls-devel mailing list