aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-09-01 14:07:45 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-09-01 14:07:45 +0200
commit8c55294ea9134c32f80d1a399a6a49ecdc9264b2 (patch)
treea21f32ae1501abf56c21f49f588503580a2c12ba /include
parent50d8d75d890e16e8d4d3f4dd51de05812c0c3a1f (diff)
downloadlibssh-8c55294ea9134c32f80d1a399a6a49ecdc9264b2.tar.gz
libssh-8c55294ea9134c32f80d1a399a6a49ecdc9264b2.tar.xz
libssh-8c55294ea9134c32f80d1a399a6a49ecdc9264b2.zip
Openssl implementation of threading + default imp
Diffstat (limited to 'include')
-rw-r--r--include/libssh/callbacks.h15
-rw-r--r--include/libssh/threads.h13
2 files changed, 18 insertions, 10 deletions
diff --git a/include/libssh/callbacks.h b/include/libssh/callbacks.h
index 589c0aea..e66fb64e 100644
--- a/include/libssh/callbacks.h
+++ b/include/libssh/callbacks.h
@@ -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
diff --git a/include/libssh/threads.h b/include/libssh/threads.h
index 6f82ee33..d83e4219 100644
--- a/include/libssh/threads.h
+++ b/include/libssh/threads.h
@@ -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_ */