1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-25 03:41:56 +03:00

Fix documentation bug about threading

This commit is contained in:
Aris Adamantiadis
2011-05-27 13:26:15 +02:00
parent 17454caf64
commit c84380bad5

View File

@ -6,16 +6,16 @@ libssh may be used in multithreaded applications, but under several conditions :
- Threading must be initialized during the initialization of libssh. This - Threading must be initialized during the initialization of libssh. This
initialization must be done outside of any threading context. initialization must be done outside of any threading context.
- If pthreads is being used by your application (or your framework's backend), - If pthreads is being used by your application (or your framework's backend),
you must link with libssh_threads_pthread dynamic library and initialize you must link with libssh_threads dynamic library and initialize
threading with the ssh_threads_pthreads threading object. threading with the ssh_threads_pthreads threading object.
- If an other threading library is being used by your application, you must - If an other threading library is being used by your application, you must
implement all the methods of the ssh_threads_callbacks_struct structure implement all the methods of the ssh_threads_callbacks_struct structure
and initialize libssh with it. and initialize libssh with it.
- At all times, you may use different sessions inside threads, make parallel - At all times, you may use different sessions inside threads, make parallel
connections, read/write on different sessions and so on. You can use a connections, read/write on different sessions and so on. You *cannot* use a
single session in several channels at the same time. This will lead to single session (or channels for a single session) in several threads at the same
internal state corruption. This limitation is being worked out and will time. This will most likely lead to internal state corruption. This limitation is
maybe disappear later. being worked out and will maybe disappear later.
@subsection threads_init Initialization of threads @subsection threads_init Initialization of threads
@ -44,10 +44,10 @@ ssh_threads_set_callbacks(ssh_threads_pthread);
ssh_init(); ssh_init();
@endcode @endcode
However, you must be sure to link with the library ssh_threads_pthread. If However, you must be sure to link with the library ssh_threads. If
you're using gcc, you must use the commandline you're using gcc, you must use the commandline
@code @code
gcc -o output input.c -lssh -lssh_threads_pthread gcc -o output input.c -lssh -lssh_threads
@endcode @endcode