• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help needed with synchronization  RSS feed

 
Varun Goenka
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once a thread enters the monitor on a synchronized method it cannot be blocked or it cannot sleep right?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Varun Goenka wrote:Once a thread enters the monitor on a synchronized method it cannot be blocked or it cannot sleep right?


No. Owning a lock doesn't mean that it can't block on another lock. Or (doesn't mean that it) can't block on other resources such as I/O. And it can certainly call the Thread.sleep() method.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!