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 文档

属性 setter 文档:

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

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

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

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

在 1.0 中添加。

适用于 . 的 java.lang.ThreadGroup.setMaxPriority(int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

另请参阅