pub(crate) fn gettid() -> i64
Returns the calling thread’s OS tid (gettid syscall) so a stop/start issued from inside the sink can detect it is on one of the run’s own threads and avoid self-joining.
gettid