• Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • SixLabors.ImageSharp.Web
      • FormattedImage
      • FormatUtilities
      • ImageCacheMetadata
      • ImageMetadata
    • SixLabors.ImageSharp.Web.Caching
      • CacheHash
      • ICacheHash
      • IImageCache
      • PhysicalFileSystemCache
      • PhysicalFileSystemCacheOptions
    • SixLabors.ImageSharp.Web.Commands
      • CommandParser
      • DictionaryExtensions
      • IRequestParser
      • PresetOnlyQueryCollectionRequestParser
      • PresetOnlyQueryCollectionRequestParserOptions
      • QueryCollectionRequestParser
    • SixLabors.ImageSharp.Web.Commands.Converters
      • ICommandConverter
      • ICommandConverter<T>
    • SixLabors.ImageSharp.Web.DependencyInjection
      • ApplicationBuilderExtensions
      • IImageSharpBuilder
      • ImageSharpBuilderExtensions
      • ImageSharpConfiguration
      • ServiceCollectionExtensions
    • SixLabors.ImageSharp.Web.Middleware
      • ConcurrentDictionaryExtensions
      • ImageCommandContext
      • ImageProcessingContext
      • ImageSharpMiddleware
      • ImageSharpMiddlewareOptions
    • SixLabors.ImageSharp.Web.Processors
      • BackgroundColorWebProcessor
      • FormatWebProcessor
      • IImageWebProcessor
      • JpegQualityWebProcessor
      • ResizeWebProcessor
    • SixLabors.ImageSharp.Web.Providers
      • IImageProvider
      • PhysicalFileSystemProvider
      • ProcessingBehavior
    • SixLabors.ImageSharp.Web.Resolvers
      • IImageCacheResolver
      • IImageResolver
      • PhysicalFileSystemCacheResolver
      • PhysicalFileSystemResolver
    • SixLabors.ImageSharp.Web.Synchronization
      • AsyncKeyLock<TKey>
      • AsyncKeyReaderWriterLock<TKey>
      • AsyncLock
      • AsyncReaderWriterLock
      • RefCountedConcurrentDictionary<TKey, TValue>

    Class AsyncKeyLock<TKey>

    Extension of the AsyncLock that enables fine-grained locking on a given key. Concurrent 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
    AsyncKeyLock<TKey>
    Implements
    IDisposable
    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 AsyncKeyLock<TKey> : IDisposable
    Type Parameters
    Name Description
    TKey

    The type of the key.

    Constructors

    | Improve this Doc View Source

    AsyncKeyLock(Int32)

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

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

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

    Methods

    | Improve this Doc View Source

    Dispose()

    Releases all resources used by the current instance of the AsyncKeyLock<TKey> class.

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    LockAsync(TKey)

    Locks the current thread asynchronously.

    Declaration
    public Task<IDisposable> LockAsync(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.

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX