Getting thread id of current method call Getting thread id of current method call multithreading multithreading

Getting thread id of current method call


#include <pthread.h>...mach_port_t machTID = pthread_mach_thread_np(pthread_self());NSLog(@"current thread: %x", machTID);


In Swift 5

print("Current thread \(Thread.current)")