class Syn::RWLock

Overview

A many readers, mutually exclusive writer lock.

Allows readers to run concurrently but ensures that they will never run concurrently to a writer. Writers are mutually exclusive to both readers and writers.

Defined in:

rw_lock.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(type : Core::Mutex::Type = :checked) #

[View source]

Instance Method Detail

def lock_read(timeout : Time::Span) : Bool #

EXPERIMENTAL The timeout feature is experimental.


[View source]
def lock_read : Nil #

[View source]
def lock_read(timeout : Time::Span, &) : Bool #

EXPERIMENTAL The timeout feature is experimental.


[View source]
def lock_read(&) : Nil #

[View source]
def lock_write(timeout : Time::Span) : Bool #

EXPERIMENTAL The timeout feature is experimental.


[View source]
def lock_write : Nil #

[View source]
def lock_write(timeout : Time::Span, &) : Bool #

EXPERIMENTAL The timeout feature is experimental.


[View source]
def lock_write(&) : Nil #

[View source]
def unlock_read : Nil #

[View source]
def unlock_write : Nil #

[View source]