Subject: Re: libssh2 in a multi threaded application

Re: libssh2 in a multi threaded application

From: Daniel Stenberg <>
Date: Tue, 31 Mar 2009 13:21:13 +0200 (CEST)

On Sun, 29 Mar 2009, Daniel Stenberg wrote:

> Yes, I'm quite sure we need something like that for the OpenSSL/gcrypt inits
> to remain safe.
> libssh2_init() and libssh2_cleanup() perhaps.

I'm thinking this is a fine addition for 1.2.

Does anyone have any particular opinion on how they should work? I mean is
there for example occasions when they shouldn't init the underlying crypto

I would also like us to produce a more general docs for libssh2 on how it acts
and what to think about when used with threads. Like right now applications
MUST also set the crypto lib's mutex callbacks. We could consider detecting a
threads library and setting these callbacks as part of the init/cleanup
mentioned above...

libssh2-devel mailing list
Received on 2009-03-31