Open sandboxFocus

Method WaitForInitialization

WaitForInitialization(IThreadAware, TimeSpan?, CancellationToken)

Actively waits for initialization of a thread-aware object, that is, for the constructor to complete.

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

The object to wait for.

TimeSpan? timeout

The timeout.

CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
bool

true if the waiting succeeded.

Remarks

This method may introduce deadlocks if it is used improperly.