Python has a method called threading.enumerate()
that returns all threads belonging to a process. How can this be done in Swift (on macOS/Linux)? I want to get an Array
of String
s that belongs to the process, regardless of wether I created it or a library created it.
The kinds of threads that I want are those that will be shown when I execute ps -T
.