Java Language: Difference between revisions
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
* [[Java#Language|Java]] | * [[Java#Language|Java]] | ||
=Keywords= | |||
* <tt>synchronized</tt> | |||
=Statements= | =Statements= |
Revision as of 03:22, 21 March 2018
Internal
Keywords
- synchronized
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.