Add flag to use gettid() instead of getpid().