Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exclusive access to change a variable

 
abhijatalok alok
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a multi-threaded app and a method requires exclusive access to change a variable. How do I ensure that?
 
Rob Spoor
Sheriff
Pie
Posts: 20510
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to a forum dedicated to these questions: Threads and Synchronization. The latter word is what you'll need.
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use java.util.concurrent.Atomic... or synchronization
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic