SYNCHRONIZED

NOTE: This API is deprecated. Use lock(), wlock(), rlock() or the withLock functions instead. In the future it will be marked with a deprecation attribute to emit build-time warnings, and then it will be removed entirely.

Synopsis

Declared in <folly/Synchronized.h>

#define SYNCHRONIZED(...)

Description

SYNCHRONIZED is the main facility that makes Synchronized<T> helpful. It is a pseudo-statement that introduces a scope where the object is locked. Inside that scope you get to access the unadorned datum.

Example:

Synchronized<vector<int>> svector; ... SYNCHRONIZED (svector) { ... use svector as a vector<int> ... } or SYNCHRONIZED (v, svector) { ... use v as a vector<int> ... }

Refer to folly/docs/Synchronized.md for a detailed explanation and more examples.