Add td:🧵:get_id().

This commit is contained in:
levlam 2022-10-04 22:48:55 +03:00
parent f0b4824924
commit e984706622
2 changed files with 12 additions and 0 deletions

View File

@ -72,6 +72,10 @@ class ThreadPthread {
using id = pthread_t;
id get_id() noexcept {
return thread_;
}
static void send_real_time_signal(id thread_id, int real_time_signal_number);
#if TD_HAVE_THREAD_AFFINITY

View File

@ -79,6 +79,14 @@ class ThreadStl {
using id = std::thread::id;
#endif
id get_id() noexcept {
#if TD_WINDOWS
return GetThreadId(thread_.native_handle());
#else
return thread_.get_id();
#endif
}
static void send_real_time_signal(id thread_id, int real_time_signal_number) {
// not supported
}