Method | Description | |
---|---|---|
Run ( ) : void |
Executes the action on this thread or marks the operation as pending if the operation is already running. When the operation is marked as pending, it will run again after the operation that is currently running has completed. This is useful if an update has invalidated the operation that is currently running and will therefore need to be run again. This method does not guarantee that control will be returned to the thread that called it. If other threads continuously mark the operation as pending, this thread will continue to run the operation indefinitely. |
|
RunOnce ( ) : void |
Executes the action on this thread or marks the operation as pending if the operation is already running. When the operation is marked as pending, it will run again after the operation that is currently running has completed. This is useful if an update has invalidated the operation that is currently running and will therefore need to be run again. |
|
RunOnceAsync ( ) : void |
Executes the action on another thread or marks the operation as pending if the operation is already running. When the operation is marked as pending, it will run again after the operation that is currently running has completed. This is useful if an update has invalidated the operation that is currently running and will therefore need to be run again. |
|
TryRun ( ) : void |
Attempts to execute the action on this thread. Does nothing if the operation is already running. This method does not guarantee that control will be returned to the thread that called it. If other threads continuously mark the operation as pending, this thread will continue to run the operation indefinitely. |
|
TryRunOnce ( ) : void |
Attempts to execute the action on this thread. Does nothing if the operation is already running.
|
|
TryRunOnceAsync ( ) : void |
Attempts to execute the action on another thread. Does nothing if the operation is already running.
|
Method | Description | |
---|---|---|
ExecuteAction ( ) : bool |
Executes the action once on the current thread.
|
|
ExecuteActionAsync ( ) : void |
Executes the action on a separate thread. Implementers should call ExecuteAction on a separate thread and check the return value. If it returns true, that means it needs to run again. The following is a sample implementation using a regular dedicated thread. |
|
SynchronizedOperationBase ( System.Action action ) : System |
Creates a new instance of the SynchronizedOperationBase class.
|
|
SynchronizedOperationBase ( System.Action action, Action |
Creates a new instance of the SynchronizedOperationBase class.
|
protected abstract ExecuteActionAsync ( ) : void | ||
return | void |
protected SynchronizedOperationBase ( System.Action action ) : System | ||
action | System.Action | The action to be performed during this operation. |
return | System |
protected SynchronizedOperationBase ( System.Action action, Action |
||
action | System.Action | The action to be performed during this operation. |
exceptionAction | Action |
The action to be performed if an exception is thrown from the action. |
return | System |