File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android 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: 18545
    
  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)
 
wood burning stoves
 
subject: synchronize variable by lock
 
Similar Threads
access a private member
Garbage collection query
GC
Why we need constructor in Abstract Class ??
Garbage Collection