Java Language: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 5: Line 5:
=Keywords=
=Keywords=


* <tt>synchronized</tt>
* <tt>synchronized</tt> ([[#synchronized_statement|statement]] and [[#synchronized_modifier|modifier]])


=Statements=
=Statements=

Revision as of 03:23, 21 March 2018

Internal

Keywords

Statements

synchronized

The synchronized statement acquires a mutual-exclusion lock on behalf of the executing thread, executes a block, then releases the lock. While the executing thread owns the log, no other thread may acquire the lock.

synchronized (expression) block

The type of expression must be a reference type.

Modifiers

synchronized