#include <thread>#include <iostream>#include <pthread.h> using namespace std; int main() { thread t1; cout << t1.get_id() << endl; pthread_setname_np( t1.native_handle(), "thread1"); cout << t1.get_id() << endl; return 0;}
Standard input is empty
/home/23c0Or/ccjHG8kq.o: In function `main': prog.cpp:(.text.startup+0x35): undefined reference to `pthread_setname_np' collect2: error: ld returned 1 exit status
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!