55 delete (
mutex *)*lock;
60 ((
mutex *)*lock)->lock();
65 ((
mutex *)*lock)->unlock();
71 lock_guard<mutex> lock(ms_thread_id_mutex);
72 auto iter = ms_thread_id_map.find(this_thread::get_id());
73 if (iter == ms_thread_id_map.end()) {
74 unsigned long id = ++ms_thread_id_next;
75 ms_thread_id_map[this_thread::get_id()] = id;
static unsigned long thread_id()
Callback for obtaining current thread ID.
static struct ssh_threads_callbacks_struct * get()
Gets libssh threads callbacks structure.
static int mutex_init(void **priv)
Mutex initializaton callback.
static std::unordered_map< std::thread::id, int > ms_thread_id_map
Mapping from std::thread::id to unique thread ID number.
static std::mutex ms_thread_id_mutex
Mutex for serializing access to static data members
static unsigned long ms_thread_id_next
Next thread ID.
Declarations for SshThreadsCallbacks.
static int mutex_destroy(void **lock)
Mutex destroy callback.
static int mutex_unlock(void **lock)
Mutex unlock callback.
static int mutex_lock(void **lock)
Mutex lock callback.
Compatibility Macros for C/C++.
Thread callbacks for libssh