This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

synchronized static methods

 
mayur dhawan
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If we declare a method as public synchronized static void doThings(){}

then will the executing thread automatically take the Class lock?
If yes then can you explain how?

thanks in advance
mayur
 
camilo lopes
Ranch Hand
Posts: 202
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because one method static pertence the class then if you lock the o method static you isn't lock one instance and so the class.
always that you use static the atributte pertence the class. don't forget.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic