Subject: Re: LIBSSH2_CHANNEL struct can be shared between the threads in c++??

Re: LIBSSH2_CHANNEL struct can be shared between the threads in c++??

From: Peter Stuge <peter_at_stuge.se>
Date: Tue, 19 Feb 2019 09:07:05 +0000

Richa Mehta wrote:
> as at a time only thread is accessing the channel do I require mutex to
> protect the session and channel??

If your software only ever calls libssh2 from one thread then you
don't technically need a mutex. This is an odd design, but oh well.

> And Thread that has openend the session, that thread should only
> close the session???

Which thread does not matter, it is just important that only one
thread closes the session.

//Peter
_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2019-02-19