ThreadGroup.MaxPriority 属性

定义

返回此线程组的最大优先级。 - 或 - 设置组的最大优先级。

public int MaxPriority { [Android.Runtime.Register("getMaxPriority", "()I", "")] get; [Android.Runtime.Register("setMaxPriority", "(I)V", "")] set; }
[<get: Android.Runtime.Register("getMaxPriority", "()I", "")>]
[<set: Android.Runtime.Register("setMaxPriority", "(I)V", "")>]
member this.MaxPriority : int with get, set

属性值

此线程组中的线程可以具有的最大优先级。

属性

例外

如果新优先级大于 Thread.MAX_PRIORITY 或小于 Thread.MIN_PRIORITY

注解

属性 getter 文档:

返回此线程组的最大优先级。 属于此组的线程的优先级不能高于最大优先级。

在 1.0 中添加。

java.lang.ThreadGroup.getMaxPriority()Java 文档。

属性资源库文档:

设置组的最大优先级。 线程组中已具有较高优先级的线程不受影响。

首先, checkAccess 调用此线程组的 方法时不带参数;这可能会导致安全异常。

pri如果 参数小于Thread#MIN_PRIORITY或大于 Thread#MAX_PRIORITY,则将其固定到这些值。

否则,此 ThreadGroup 对象的优先级设置为指定 pri 和此线程组父级允许的最大优先级的较小。 (如果此线程组是没有父级的系统线程组,则其最大优先级只是设置为 pri.) 则对于属于此线程组的每个线程组,以递归方式 pri 调用此方法作为其参数。

在 1.0 中添加。

java.lang.ThreadGroup.setMaxPriority(int)Java 文档。

此页面的部分内容是基于 创建和共享的工作进行的修改,并根据 署名许可中所述的术语使用。

适用于

另请参阅