Message::setTid() takes a value of type long and Message::getTid() returns a value of type long.
At least with GCC on 64-bit Linux systems, long is 64-bits wide and so is large enough to hold a 64-bit thread ID, which is good. However, the internal _tid variable in Message is declared as an int and so the 64-bit thread IDs are truncated to 32 bits. _tid should be declared as a long, like _pid.