“Get” Test Functions
Use the following functions at run-time to determine whether the current environment allows you to query the corresponding thread attributes:
*canGetConcurrencyPolicy()
*canGetContentionScope()
*canGetInheritancePolicy()
*canGetPriority()
*canGetProcessScopePriority()
*canGetSchedulingPolicy()
*canGetStackCommitSize()
*canGetStackReserveSize()
*canGetStartPolicy()
*canGetSystemScopePriority()
*canGetTimeSliceQuantum()
*canGetUserStack()
These functions follow several rules:
*They return false if the corresponding attribute is not supported in the current environment or if the corresponding “get” function cannot return a legal value under current circumstances.
*They return true if the corresponding attribute is supported in the current environment and the corresponding “get” function can return a legal value under current circumstances.
If the corresponding attribute value has not yet been set, then a return value of true indicates that a default value is defined and can be queried.
*They return true if the corresponding attribute still has the value previously set by a call to the matching “set” function. This behavior is similar to that in the “is set” functions.
If the inheritance policy is RW_THR_INHERIT, the scheduling policy, priority, and time-slice quantum values cannot be queried for their default values. If these scheduling attributes are inherited, the “get min” and “get max” functions for these attributes will likely produce RWTHROperationNotAvailable exceptions because not enough information is available to determine the legal range of values.
Even if an attribute is supported in a particular environment, you might still be restricted from getting and setting that attribute as a consequence of other attribute values. As an example, the concurrency policy attribute might only be accessible when the contention scope is set for process-scope. Some attribute settings might also require specific security authorizations or privileges.
Once a thread has been created and is active, you can use the following RWThread or RWThreadSelf functions to test whether or not you can get the corresponding attribute value for an active thread:
*canGetPriority()
*canGetProcessScopePriority()
*canGetSchedulingPolicy()
*canGetSystemScopePriority()
*canGetTimeSliceQuantum()