共用方式為


SchedulerPolicy::SetPolicyValue Method

Sets the value of the policy key supplied as the _Key parameter and returns the old value.

unsigned int SetPolicyValue(
   PolicyElementKey _Key,
   unsigned int _Value
);

Parameters

  • _Key
    The policy key to set a value for.

  • _Value
    The value to set the policy key to.

Return Value

If the key specified by the _Key parameter is supported, the old policy value for the key cast to an unsigned int.

Remarks

The method will throw invalid_scheduler_policy_key for an invalid policy key or any policy key whose value cannot be set by the SetPolicyValue method.

The method will throw invalid_scheduler_policy_value for a value that is not supported for the key specified by the _Key parameter.

Note that this method is not allowed to set the MinConcurrency or MaxConcurrency policies. To set these values, use the SetConcurrencyLimits method.

Requirements

Header: concrt.h

Namespace: concurrency

See Also

Reference

SchedulerPolicy Class

SchedulerPolicy::GetPolicyValue Method

SchedulerPolicy::SetConcurrencyLimits Method

PolicyElementKey Enumeration