aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-09-06 16:52:14 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-09-06 16:52:14 +0200
commit49f57a8d0dcf990169e2f591a937672f74ffa4a9 (patch)
treee8f872af3dd4f0c7d02ef47e214f016747396c23 /include
parentfbe102bada583f308450c27e256053b51643a532 (diff)
downloadlibssh-49f57a8d0dcf990169e2f591a937672f74ffa4a9.tar.gz
libssh-49f57a8d0dcf990169e2f591a937672f74ffa4a9.tar.xz
libssh-49f57a8d0dcf990169e2f591a937672f74ffa4a9.zip
Implemented the noop and native pointers
Diffstat (limited to 'include')
-rw-r--r--include/libssh/callbacks.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/libssh/callbacks.h b/include/libssh/callbacks.h
index b7047d65..10ee6508 100644
--- a/include/libssh/callbacks.h
+++ b/include/libssh/callbacks.h
@@ -255,8 +255,27 @@ LIBSSH_API int ssh_set_callbacks(ssh_session session, ssh_callbacks cb);
*/
typedef int (*ssh_thread_callback) (void **lock);
+
+/**
+ * @brief Type of the threading solution implemented behind
+ * these callbacks
+ */
+enum ssh_threads_type_e {
+ /** The thread callbacks do nothing */
+ ssh_threads_type_noop,
+ /** The thread callbacks use pthread */
+ ssh_threads_type_pthread,
+ /** The thread callbacks use win32 threads */
+ ssh_threads_type_win32,
+ /** The thread callbacks use pth */
+ ssh_threads_type_pth,
+ /** The thread callbacks are unknown or different */
+ ssh_threads_type_other
+};
+
typedef unsigned long (*ssh_thread_id_callback) (void);
struct ssh_threads_callbacks_struct {
+ enum ssh_threads_type_e type;
ssh_thread_callback mutex_init;
ssh_thread_callback mutex_destroy;
ssh_thread_callback mutex_lock;
@@ -277,7 +296,9 @@ struct ssh_threads_callbacks_struct {
LIBSSH_API int ssh_threads_set_callbacks(struct ssh_threads_callbacks_struct
*cb);
-extern struct ssh_threads_callbacks_struct ssh_pthread_callbacks;
+extern struct ssh_threads_callbacks_struct ssh_threads_pthread;
+extern struct ssh_threads_callbacks_struct ssh_threads_noop;
+extern struct ssh_threads_callbacks_struct ssh_threads_native;
/** @} */
#ifdef __cplusplus