lock overloads

Synopses

Declared in <folly/Synchronized.h>

Make an exclusive locking helper.

template<
    typename D,
    typename M,
    typename... Args>
auto
lock(
    Synchronized<D, M>& synchronized,
    Args&&... args);

Make an exclusive locking helper for a const object.

template<
    typename D,
    typename M,
    typename... Args>
auto
lock(
    Synchronized<D, M> const& synchronized,
    Args&&... args);

Acquire locks on many lockables or synchronized instances in such a way that the sequence of calls within the function does not cause deadlocks.

template<
    typename LockableOne,
    typename LockableTwo,
    typename... Lockables>
void
lock(
    LockableOne& one,
    LockableTwo& two,
    Lockables&... lockables);

Return Value

A locking helper for use with lock() or synchronized().

Parameters

Name

Description

synchronized

The object to lock.

args

Extra arguments forwarded to the locking function.

one

The first lockable to acquire.

two

The second lockable to acquire.

lockables

Any additional lockables to acquire.

Created with MrDocs