Click or drag to resize

SingleOccurrenceAction Class

A helper class that will properly coordinate any number of Actions from different threads.
Inheritance Hierarchy
SystemObject
  GSF.ThreadingSingleOccurrenceAction

Namespace: GSF.Threading
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
public class SingleOccurrenceAction
View Source

The SingleOccurrenceAction type exposes the following members.

Constructors
 NameDescription
Public methodSingleOccurrenceActionInitializes a new instance of the SingleOccurrenceAction class
Top
Properties
 NameDescription
Public propertyIsCallbackExecuting Gets if the callback is executing
Public propertyIsCallbackPendingOnBlocks Gets if the signal action is currently pending. This means all future calls to TryBlockAction will fail.
Public propertyIsSignalingCompleted Gets if all actions associated with the signaling of this class is complete.
Top
Methods
 NameDescription
Public methodBlockAction(Action, Action) Attempts to block this class from being signaled.
Public methodBlockActionT(FuncT, FuncT) Attempts to block this class from being signaled.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodExecuteAndWait Signals this class and waits for all blockers to exit before calling the .. If called concurrently, the calling thread blocks until the completes. If called from within the , the function returns immediately. The same thread calling this method will always call the . Only one callback will be executed by this class and it will be the first one to call either ExecuteWithoutWait(Action) or ExecuteAndWait(Action).
Public methodExecuteWithoutWait Registers this callback to occur once all blocking call complete. This function will return immediately and the callback may or may not be run. Only one callback will be executed by this class and it will be the first one to call either ExecuteWithoutWait(Action) or ExecuteAndWait(Action).
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodTryBlockAction(Action) Attempts to block this class from being signaled.
Public methodTryBlockAction(Boolean) Attempts to block this class from being signaled. Be sure to call within a using block.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
This class is commonly used to properly coordinate the disposal of object. Remarks: Adapted from GSF.Threading.ReaderWriterSpinLock
See Also