DispatchedExecutionMode Enumeration |
Determines whether the caller of a dispatched method (see DispatchedAttribute)
waits for the called method.
Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
public enum DispatchedExecutionMode
Member name | Value | Description | |
---|---|---|---|
Default | 0 | Default (Blocking). | |
Blocking | 0 | The caller waits for the called method in all cases. | |
NonBlocking | 1 | The caller never waits for the called method. The method is enqueued for later execution even on the same context. Methods that have a non-void return type or ref or out parameters cannot be dispatched in non-blocking mode. | |
NonBlockingContextSwitch | 2 | If the caller context equals the target context (e.g. if the caller is the UI thread and the object is affine to the UI thread), the method is invoked immediately in the current context in a blocking way. Otherwise, if a context switch is necessary, the method call is enqueued for later execution and the caller continues without waiting. Methods that have a non-void return type or ref or out parameters cannot be dispatched in non-blocking mode. |