Acquiring a thread identifier (tid) in glib

I use glib to create threads:

g_thread_create()

How can I get the thread id (number)?

+3
source share
2 answers

You can not. The thread id is abstracted into GLib. Why do you need this?

+4
source

If you use vala, you can use:

   var t = Thread.self<bool> () ;
   message ("OTHER THREAD: %p", t) ;

Conclusion:

** Message: vala-thread.vala:6: OTHER THREAD: 0x165e400
0
source

Source: https://habr.com/ru/post/1763049/


All Articles