Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

What could be the understanding of the following?
I have gone through thisthis post at SO but still at a loss to assemble it.

code1:

synchronized(this){ // some code } 

code2:

Object lock = new Object(); synchronized(lock){ // some code } 

Any tutorial, or some links to explain synchronized like they explain it to a child?

What could be the understanding of the following?
I have gone through this post at SO but still at a loss to assemble it.

code1:

synchronized(this){ // some code } 

code2:

Object lock = new Object(); synchronized(lock){ // some code } 

Any tutorial, or some links to explain synchronized like they explain it to a child?

What could be the understanding of the following?
I have gone through this post at SO but still at a loss to assemble it.

code1:

synchronized(this){ // some code } 

code2:

Object lock = new Object(); synchronized(lock){ // some code } 

Any tutorial, or some links to explain synchronized like they explain it to a child?

Source Link
Kevin Boyd
  • 12.4k
  • 29
  • 91
  • 131

using synchronized in Threads

What could be the understanding of the following?
I have gone through this post at SO but still at a loss to assemble it.

code1:

synchronized(this){ // some code } 

code2:

Object lock = new Object(); synchronized(lock){ // some code } 

Any tutorial, or some links to explain synchronized like they explain it to a child?