[#SYNCHRONIZED]
= SYNCHRONIZED
:mrdocs:

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

== Synopsis

Declared in `&lt;folly&sol;Synchronized&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
#define SYNCHRONIZED(...)

----

== Description

SYNCHRONIZED is the main facility that makes Synchronized&lt;T&gt; helpful&period; It is a pseudo&hyphen;statement that introduces a scope where the object is locked&period; Inside that scope you get to access the unadorned datum&period;

Example&colon;

Synchronized&lt;vector&lt;int&gt;&gt; svector&semi; &period;&period;&period; SYNCHRONIZED (svector) &lcub; &period;&period;&period; use svector as a vector&lt;int&gt; &period;&period;&period; &rcub; or SYNCHRONIZED (v, svector) &lcub; &period;&period;&period; use v as a vector&lt;int&gt; &period;&period;&period; &rcub;

Refer to folly&sol;docs&sol;Synchronized&period;md for a detailed explanation and more examples&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
