• Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • SixLabors.ImageSharp.Web
      • CaseHandlingUriBuilder
      • CaseHandlingUriBuilder.CaseHandling
      • CommandHandling
      • ExifOrientationUtilities
      • Format
      • FormatCommand
      • FormatUtilities
      • FormattedImage
      • HMACUtilities
      • ImageCacheMetadata
      • ImageMetadata
      • RequestAuthorizationUtilities
      • Resampler
      • ResamplerCommand
    • SixLabors.ImageSharp.Web.Caching
      • ICacheHash
      • ICacheKey
      • IImageCache
      • LegacyV1CacheKey
      • PhysicalFileSystemCache
      • PhysicalFileSystemCacheOptions
      • SHA256CacheHash
      • UriAbsoluteCacheKey
      • UriAbsoluteLowerInvariantCacheKey
      • UriRelativeCacheKey
      • UriRelativeLowerInvariantCacheKey
    • SixLabors.ImageSharp.Web.Commands
      • CommandCollection
      • CommandCollectionExtensions
      • CommandParser
      • IRequestParser
      • PresetOnlyQueryCollectionRequestParser
      • PresetOnlyQueryCollectionRequestParserOptions
      • QueryCollectionRequestParser
    • SixLabors.ImageSharp.Web.Commands.Converters
      • ArrayConverter<T>
      • ColorConverter
      • EnumConverter
      • ICommandConverter
      • ICommandConverter<T>
      • IntegralNumberConverter<T>
      • ListConverter<T>
      • SimpleCommandConverter<T>
    • SixLabors.ImageSharp.Web.DependencyInjection
      • ApplicationBuilderExtensions
      • IImageSharpBuilder
      • ImageSharpBuilderExtensions
      • ServiceCollectionExtensions
    • SixLabors.ImageSharp.Web.Middleware
      • ImageCommandContext
      • ImageProcessingContext
      • ImageSharpMiddleware
      • ImageSharpMiddlewareOptions
    • SixLabors.ImageSharp.Web.Processors
      • AutoOrientWebProcessor
      • BackgroundColorWebProcessor
      • FormatWebProcessor
      • IImageWebProcessor
      • QualityWebProcessor
      • ResizeWebProcessor
    • SixLabors.ImageSharp.Web.Providers
      • FileProviderImageProvider
      • IImageProvider
      • PhysicalFileSystemProvider
      • PhysicalFileSystemProviderOptions
      • ProcessingBehavior
      • WebRootImageProvider
    • SixLabors.ImageSharp.Web.Resolvers
      • FileProviderImageResolver
      • IImageCacheResolver
      • IImageResolver
      • PhysicalFileSystemCacheResolver
    • SixLabors.ImageSharp.Web.Synchronization
      • AsyncKeyLock<TKey>
      • AsyncKeyReaderWriterLock<TKey>
      • AsyncLock
      • AsyncReaderWriterLock
      • RefCountedConcurrentDictionary<TKey, TValue>
    • SixLabors.ImageSharp.Web.TagHelpers
      • HmacTokenTagHelper
      • ImageTagHelper

    Class AsyncKeyReaderWriterLock<TKey>

    Extension of the AsyncReaderWriterLock that enables fine-grained locking on a given key. Concurrent write lock requests using different keys can execute simultaneously, while requests to lock using the same key will be forced to wait. This object is thread-safe and internally uses a pooling mechanism to minimize allocation of new locks.

    Inheritance
    object
    AsyncKeyReaderWriterLock<TKey>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: SixLabors.ImageSharp.Web.Synchronization
    Assembly: SixLabors.ImageSharp.Web.dll
    Syntax
    public class AsyncKeyReaderWriterLock<TKey> where TKey : notnull
    Type Parameters
    Name Description
    TKey

    The type of the key.

    Constructors

    | Edit this page View Source

    AsyncKeyReaderWriterLock(int)

    Initializes a new instance of the AsyncKeyReaderWriterLock<TKey> class.

    Declaration
    public AsyncKeyReaderWriterLock(int maxPoolSize = 64)
    Parameters
    Type Name Description
    int maxPoolSize

    The maximum number of locks that should be pooled for reuse.

    Methods

    | Edit this page View Source

    ReaderLockAsync(TKey)

    Locks the current thread in read mode asynchronously.

    Declaration
    public Task<IDisposable> ReaderLockAsync(TKey key)
    Parameters
    Type Name Description
    TKey key

    The key identifying the specific object to lock against.

    Returns
    Type Description
    Task<IDisposable>

    The IDisposable that will release the lock.

    | Edit this page View Source

    WriterLockAsync(TKey)

    Locks the current thread in write mode asynchronously.

    Declaration
    public Task<IDisposable> WriterLockAsync(TKey key)
    Parameters
    Type Name Description
    TKey key

    The key identifying the specific object to lock against.

    Returns
    Type Description
    Task<IDisposable>

    The IDisposable that will release the lock.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX