This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes synchronize variable by lock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "synchronize variable by lock" Watch "synchronize variable by lock" New topic
Author

synchronize variable by lock

Stefan Müllerheim
Greenhorn

Joined: Sep 17, 2010
Posts: 12
hi, i try to synchronize the access to a variable and wrote something below. is that correct? see anybody any fault?


less is more.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18505
    
  40

BTW, there is no need to create a new local variable...



Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: synchronize variable by lock
 
Similar Threads
access a private member
Garbage collection query
GC
Why we need constructor in Abstract Class ??
Garbage Collection