aspose file tools*
The moose likes Threads and Synchronization and the fly likes Sharing variable between two threads. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply locked New topic
Author

Sharing variable between two threads.

Joseph Cho
Ranch Hand

Joined: Feb 19, 2012
Posts: 42
I'm trying to have one thread keep track of the time while the main thread does the work.. For some reason the thread is not getting the updated variable, how do I get this to work? I tried using a static variable but it's not working..

Here is the code:

Rakesh K. Cherukuri
Ranch Hand

Joined: Jun 01, 2010
Posts: 48

Duplicate of http://www.coderanch.com/t/597439/threads/java/Sharing-variable-between-two-threads

The other one already has responses


Warm Regards,
Rakesh
 
Don't get me started about those stupid light bulbs.
 
subject: Sharing variable between two threads.