void print_id(thread& t) { if (t.get_id()==thread::id{}) cout << "t not joinable\n"; else cout << "t's id is " << t.get_id() << '\n'; }
string CriticalSection::thread_id(thread& t) { string id; stringstream s; s << t.get_id(); s >> id; return id; }
bool SerialPort::isCurrentThread() const { return m_thread.get_id() == std::this_thread::get_id(); }
bool thread::operator ==(const thread& rhs) const { return get_id() == rhs.get_id(); }