Jak znaleźć nazwę wątku nadrzędnego?

Wiem, że możemy mieć „rodziców” i „dzieci”, kiedy mówimy o procesach. Ale czy możliwe jest uzyskanie rodzicaThread imię?

Zrobiłem moje badania, ale znalazłem odpowiedź tylko dla.Netto

Edytuj: Próbowałem ustawić nazwy:

public class Main {

    public static void main(String[] args) {
        Thread r = new ThreadA();
        r.start();
    }

}



public class ThreadA extends Thread {
    public void run() {
        Thread.currentThread().setName("Thread A");
        System.out.println("Here  " + Thread.currentThread().getName());
        Thread r = new ThreadB();
        r.setName(Thread.currentThread().getName());
        r.start();
    }
}

public class ThreadB extends Thread {
    public void run() {
        Thread.currentThread().setName("Thread B");
        System.out.println("Here " + Thread.currentThread().getName());
        Thread r = new ThreadC();
        r.setName(Thread.currentThread().getName());
        r.start();
    }
}

public class ThreadC extends Thread {
    public void run() {
        Thread.currentThread().setName("Thread C");
        System.out.println("Here " + Thread.currentThread().getName());
    }
}

questionAnswers(4)

yourAnswerToTheQuestion