thread_self/1

thread_self(- Id)*

Get the Prolog thread identifier of the running thread. If the thread has an alias, the alias-name is returned.