PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingThreading­ServicesWait­For­Initialization
Open sandboxFocus

ThreadingServices.WaitForInitialization Method

WaitForInitialization(IThreadAware, Nullable<TimeSpan>, CancellationToken)

Actively waits for initialization of a thread aware object, i.e. for the constructor to complete.

Declaration
public static bool WaitForInitialization(IThreadAware threadAware, Nullable<TimeSpan> timeout = null, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IThreadAware threadAware

Object.

Nullable<System.TimeSpan> timeout

Timeout.

CancellationToken cancellationToken

CancellationToken.

Returns
Type Description
System.Boolean

True if the waiting succeeded.

Remarks

May introduce deadlocks if used improperly.