method is-initial-thread

Documentation for method is-initial-thread assembled from the following types:

class Thread

From Thread

(Thread) method is-initial-thread

method is-initial-thread(--> Bool)

Returns a Bool indicating whether the current thread (if called as a class method) or the Thread object on which it is called, is the initial thread the program started on.

say Thread.is-initial-thread;    # True if this is the initial thread 
say $*THREAD.is-initial-thread;  # True if $*THREAD is the initial thread

Please note there is no guarantee that this is actually the main thread from the OS's point of view. Also note that if you need this other than from a pure introspection / debugging point of view, that there are probably better ways to achieve what you're trying to achieve.