Meziantou.Framework.Threading namespace

Classes

NameDescription
AsyncAutoResetEventRepresents an asynchronous auto-reset event that signals a single waiting task when set.
AsyncLockProvides an asynchronous lock that can be awaited to ensure exclusive access to a resource.
AsyncReaderWriterLockProvides an asynchronous reader-writer lock that allows multiple readers or a single writer.
KeyedAsyncLock<TKey>Provides an asynchronous lock mechanism that locks based on a key, allowing concurrent operations on different keys.
KeyedLock<TKey>Provides a synchronous lock mechanism that locks based on a key, allowing concurrent operations on different keys.
MixedConsumerProducerProvides a parallel processing utility that allows consumers to dynamically add new items to be processed.
MixedConsumerProducerContext<T>Provides a context for MixedConsumerProducer that allows enqueuing additional items to be processed.
MixedConsumerProducerOptionsOptions that configure MixedConsumerProducer.Process, including a bound on the number of pending items.
MonoThreadedTaskSchedulerProvides a task scheduler that executes tasks on a single dedicated thread.
ResettableCancellationTokenSourceRepresents a cancellation token source that can be reset to its initial state.
SemaphoreSlimExtensionsProvides extension methods for SemaphoreSlim to simplify usage with disposable patterns.
SynchronizationContextExtensionsProvides extension methods for SynchronizationContext.

Structs

NameDescription
AsyncLock.AsyncLockLeaseRepresents a disposable lease for an AsyncLock. Disposing the lease releases the lock.
AsyncReaderWriterLock.ReleaserRepresents a disposable releaser for an AsyncReaderWriterLock. Disposing the releaser releases either the reader or writer lock.
KeyedAsyncLock<TKey>.KeyedAsyncLockLeaseRepresents a disposable lease for a KeyedAsyncLock<TKey>. Disposing the lease releases the lock for the key.
SemaphoreSlimExtensions.SemaphoreDisposerRepresents a disposable struct that releases a semaphore when disposed. Every copy of the struct releases the semaphore, so dispose exactly one copy exactly once.
SynchronizationContextExtensions.SynchronizationContextAwaiterAwaits a SynchronizationContext, resuming the awaiting method on that context.

Enums

NameDescription
ResettableCancellationTokenSourceOptionsSpecifies options for a ResettableCancellationTokenSource.