ExecutionConstraint.Install Method
Creates a subthread within the calling thread, containing a constraint that requires the calling thread to complete an operation within a specified time period and at a specified priority level.
Namespace: Microsoft.SPOT
Assembly: Microsoft.SPOT.Native (in microsoft.spot.native.dll)
Syntax
[MethodImplAttribute]
public static void Install (
int timeout,
int priority
)
Parameters
- timeout
The number of clock ticks before a ConstraintException exception is thrown. Note that the value -1 in this parameter indicates that the current constraint exception is to be uninstalled. - priority
The priority level of the calling thread.
Remarks
If the specified time period expires before the thread has completed the operation, a ConstraintException exception is thrown. Note that the time you set in the timeout parameter is standard clock time, not thread execution time.
You can raise the priority level only for threads that already have a priority level higher than 0 (zero).
Exceptions This method throws exceptions for any of the reasons (conditions) listed in the following table.
Exception | Condition |
---|---|
System.Exception | The timeout parameter is less than -1. |
System.Exception | The system is unable to identify the thread that is installing this constraint. |
System.Exception | The thread installing this contraint does not own the subthread that the constraint applies to. |
Version Information
Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.
See Also
Reference
ExecutionConstraint Class
ExecutionConstraint Members
Microsoft.SPOT Namespace