• Post Reply Bookmark Topic Watch Topic
  • New Topic

synchronized

 
Chandra Moulee
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What does synchronized(Temp.class) do??? and what happens when we pass a class name to the synchronized method.

Thanks

Mouli
 
Ulas Ergin
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Temp.class is a 'Class' object. Then you get synched on that Class.
if the class has static synchronized methods you are also synched with them
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Threads and Synchronization...
 
Tom Billings
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, "class"-object, I wonder... Get your point though ;-) Just to fill in: of course this goes for static variables as well. After all, they're the ones needing synchronization, not the methods, right?

At least I think so but, HEY!, it�s friday and I've been taking some liberties, cheers!
 
Tom Billings
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mouli,

I'd be so happy to recommend any book.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!