Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

synchronized?

 
Mike Shn
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What return type is synchronized of the function?
public synchronized void reset()
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Synchronized is not a return type, it is a modifier saying that a Thread calling this method obtains a lock, causing all other Threads trying to access that object's synchronized methods to wait until the current thread is done.
Do a search on "synchronized" for more information, or read any Java book you have available to you.
Jason
 
Junilu Lacar
Bartender
Pie
Posts: 7778
62
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The synchronized keyword marks a critical section. It is not a return type. Read more about in the Java Tutorial: http://java.sun.com/docs/books/tutorial/essential/threads/monitors.html
Junilu
[This message has been edited by JUNILU LACAR (edited December 19, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic