Thread callbacks for libssh More...
#include <SshThreadsCallbacks.h>
Static Public Member Functions | |
static int | mutex_init (void **priv) |
Mutex initializaton callback. More... | |
static int | mutex_destroy (void **lock) |
Mutex destroy callback. More... | |
static int | mutex_lock (void **lock) |
Mutex lock callback. More... | |
static int | mutex_unlock (void **lock) |
Mutex unlock callback. More... | |
static unsigned long | thread_id () |
Callback for obtaining current thread ID. More... | |
static struct ssh_threads_callbacks_struct * | get () |
Gets libssh threads callbacks structure. More... | |
Static Private Attributes | |
static std::mutex | ms_thread_id_mutex {} |
Mutex for serializing access to static data members More... | |
static unsigned long | ms_thread_id_next {} |
Next thread ID. More... | |
static std::unordered_map < std::thread::id, int > | ms_thread_id_map {} |
Mapping from std::thread::id to unique thread ID number. More... | |
static struct ssh_threads_callbacks_struct | ms_callbacks |
libssh callbacks structure More... | |
Thread callbacks for libssh
Definition at line 42 of file SshThreadsCallbacks.h.
|
static |
Gets libssh threads callbacks structure.
Allocates a ssh_threads_callbacks_struct
structure with callback functions initialized to the ones defined in this class. The type
member is set to "threads_cpp".
Definition at line 81 of file SshThreadsCallbacks.cc.
|
static |
Mutex destroy callback.
Deallocates mutex object pointed to by *lock
lock | Address of mutex pointer |
Definition at line 54 of file SshThreadsCallbacks.cc.
|
static |
Mutex initializaton callback.
Allocates a mutex object and assigns to *priv
priv | Address of mutex pointer |
Definition at line 49 of file SshThreadsCallbacks.cc.
|
static |
Mutex lock callback.
Locks mutex object pointed to by *lock
lock | Address of mutex pointer |
Definition at line 59 of file SshThreadsCallbacks.cc.
|
static |
Mutex unlock callback.
Unlocks mutex object pointed to by *lock
lock | Address of mutex pointer |
Definition at line 64 of file SshThreadsCallbacks.cc.
|
static |
Callback for obtaining current thread ID.
Definition at line 70 of file SshThreadsCallbacks.cc.
|
staticprivate |
libssh callbacks structure
Definition at line 92 of file SshThreadsCallbacks.h.
|
staticprivate |
Mapping from std::thread::id to unique thread ID number.
Definition at line 89 of file SshThreadsCallbacks.h.
|
staticprivate |
Mutex for serializing access to static data members
Definition at line 83 of file SshThreadsCallbacks.h.
|
staticprivate |
Next thread ID.
Definition at line 86 of file SshThreadsCallbacks.h.