Table of Contents

Namespace NanoByte.Common.Threading

Helpers for working with threads.

Classes

ActionExtensions

Provides extension methods for System.Action<T>

AsyncFormWrapper<T>

Lazily starts a separate thread with a message loop for a System.Windows.Forms.Form.

CancellationGuard

Ensures that a block of code running on a background thread cleanly exits before a System.Threading.CancellationTokenSource.Cancel() call completes.

FuncExtensions

Provides extension methods for System.Func<T, TResult>

JobQueue

Runs jobs on a single background thread that is started and stopped on demand.

MarshalNoTimeout

Derive from this class to enable remoting without timeouts. Keeps remoting object alive as long as process is running.

MutexLock

Provides a wrapper around System.Threading.Mutex that automatically acquires on creating and releases on Dispose().

ResultRacer

Helper for racing multiple operations against each other, providing the result of the first one that finishes.

ResultRacer<T>

Helper for racing multiple operations against each other, providing the result of the first one that finishes.

StressTest
SynchronousProgress<T>

Reports progress updates using callbacks/events. Performs the callbacks immediately on the same thread.

TaskExtensions
ThreadUtils

Provides helper methods for launching System.Threading.Threads.

WaitHandleExtensions

Provides extension methods for System.Threading.WaitHandle.

WaitTask

Waits for a System.Threading.WaitHandle to become available or the System.Threading.CancellationToken to be triggered.