Add thread_is_self function

This is useful to compare the current thread against another one.
3 files changed