Update thread.hh

Added method hasTid(), makes code even more beautifull.