mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-05 01:02:39 +03:00
Openssl implementation of threading + default imp
This commit is contained in:
@@ -248,6 +248,21 @@ typedef struct ssh_packet_callbacks_struct *ssh_packet_callbacks;
|
||||
*/
|
||||
LIBSSH_API int ssh_set_callbacks(ssh_session session, ssh_callbacks cb);
|
||||
|
||||
/** @} */
|
||||
|
||||
typedef int (*ssh_thread_callback) (void **lock);
|
||||
typedef unsigned long (*ssh_thread_id_callback) (void);
|
||||
struct ssh_threads_callbacks_struct {
|
||||
ssh_thread_callback mutex_init;
|
||||
ssh_thread_callback mutex_destroy;
|
||||
ssh_thread_callback mutex_lock;
|
||||
ssh_thread_callback mutex_unlock;
|
||||
ssh_thread_id_callback thread_id;
|
||||
};
|
||||
|
||||
LIBSSH_API int ssh_init_set_threads_callbacks(struct ssh_threads_callbacks_struct
|
||||
*cb);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -22,17 +22,10 @@
|
||||
#ifndef THREADS_H_
|
||||
#define THREADS_H_
|
||||
|
||||
typedef int (*ssh_thread_callback) (void **lock);
|
||||
struct ssh_threads_callbacks_struct {
|
||||
ssh_thread_callback mutex_init;
|
||||
ssh_thread_callback mutex_destroy;
|
||||
ssh_thread_callback mutex_lock;
|
||||
ssh_thread_callback mutex_unlock;
|
||||
};
|
||||
#include <libssh/callbacks.h>
|
||||
|
||||
int ssh_threads_init(void);
|
||||
int ssh_init_set_threads_callbacks(struct ssh_threads_callbacks_struct
|
||||
*cb);
|
||||
int ssh_init_set_threads_pthreads(void);
|
||||
void ssh_threads_finalize(void);
|
||||
|
||||
|
||||
#endif /* THREADS_H_ */
|
||||
|
||||
Reference in New Issue
Block a user