GeneralUtilsPerformSyncedActionT Method (FuncT, Object, Boolean) |
Performs the specified action, either inside a lock on syncRoot if isSynchronized is true, or normally, if isSynchronized is false.
Namespace:
SD.Tools.Algorithmia.UtilityClasses
Assembly:
SD.Tools.Algorithmia (in SD.Tools.Algorithmia.dll) Version: 1.4.0.0 (1.4.19.0711)
Syntax public static T PerformSyncedAction<T>(
Func<T> toPerform,
Object syncRoot,
bool isSynchronized
)
Public Shared Function PerformSyncedAction(Of T) (
toPerform As Func(Of T),
syncRoot As Object,
isSynchronized As Boolean
) As T
Parameters
- toPerform
- Type: SystemFuncT
To perform. - syncRoot
- Type: SystemObject
The synchronize root to lock on. - isSynchronized
- Type: SystemBoolean
if set to true the caller is synchronized.
Type Parameters
- T
- The type of the element to return
Return Value
Type:
Tthe result of toPerform
See Also