您的位置:首页 > 编程语言 > Java开发

java.lang.ThreadGroup

2013-11-07 02:19 337 查看
public final void destroy():

Destroys this thread group and all of its subgroups. This thread group must be empty, indicating that all threads that had been in this thread group have since stopped.

First, the
checkAccess
method of this thread group is called with no arguments; this may result in a security exception.

public int activeGroupCount():

Returns an estimate of the number of active groups in this thread group and its subgroups. Recursively iterates over all subgroups in this thread group.
The value returned is only an estimate because the number of thread groups may change
dynamically while this method traverses internal data structures. This method is intended primarily
for debugging and monitoring purposes.

public final void checkAccess():

Determines if the currently running thread has permission to modify this thread group.
If there is a security manager, its
checkAccess
method is called with this thread group as its argument. This may result in throwing a
SecurityException
.

public final void setMaxPriority(int pri):

Sets the maximum priority of the group. Threads in the thread group that already have a higher priority are not affected.

First, the
checkAccess
method of this thread group is called with no arguments; this may result in a security exception.

If the
pri
argument is less than
Thread.MIN_PRIORITY
or greater than
Thread.MAX_PRIORITY
, the maximum priority of the group remains
unchanged.

Otherwise, the priority of this ThreadGroup object is set to the smaller of the specified
pri
and the maximum permitted priority of the parent of this thread group. (If this thread group is the system thread group, which has no parent,
then its maximum priority is simply set to
pri
.) Then this method is called recursively, with
pri
as its argument, for every thread group that belongs to this thread group.

 

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  javaApi
相关文章推荐