Scrolling Text in a Custom Component

Chapter 10 - Thread Groups

Java Thread Programming
Paul Hyde
  Copyright 1999 Sams Publishing

Using the getThreadGroup() Method of Thread
If you need to know which thread group a thread belongs to, you can use the getThreadGroup() method on Thread . To find out which thread group threadX belongs to, use this code:
ThreadGroup groupForThreadX = threadX.getThreadGroup();
groupForThreadX is a reference to the ThreadGroup that threadX belongs to. If a thread is no longer alive , getThreadGroup() returns null instead of a ThreadGroup .
To determine which thread group the thread executing a block of code belongs to, use:
ThreadGroup group = Thread.currentThread().getThreadGroup();

Toc


Java Thread Programming
Java Thread Programming
ISBN: 0672315858
EAN: 2147483647
Year: 2005
Pages: 149
Authors: Paul Hyde

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net