Documentation for method is-initial-thread
Documentation for method is-initial-thread, assembled from the following types:
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 threadsay .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.