CoarseLocked.tryLocked

Attempt to lock, and if successful, call dg() then unlock.

  1. bool tryLocked(void delegate(T*) dg)
  2. bool tryLocked(void delegate() dg)
    struct CoarseLocked(T)
    shared
    bool
    tryLocked
    (
    scope void delegate
    ()
    dg
    )
    if (
    !is(T == shared)
    )

Parameters

dg void delegate
()

A scoped callback that is called only while this is locked.

Return Value

Type: bool

Whether or not the lock was taken.

Meta