CoarseLocked.tryLocked

Attempt to lock, and if successful, call dg(&t) for internal value t, then unlock.

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

Parameters

dg void delegate
(
T*
)

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

Return Value

Type: bool

Whether or not the lock was taken.

Meta