Re: [Java-gnome-developer] updating GNomeAppBar.progressbar while running a long process.
Brought to you by:
afcowie
From: Joao V. <jvi...@ya...> - 2005-04-19 11:30:41
|
--- Ismael Juma <is...@ju...> wrote: > It's quite late here, so I might have missed something, but to me that > code is not totally correct. You are accessing the field fraction from > two different threads, but you do not take any measures to ensure that > both threads see the correct value. I guess that since only one thread > is changing the value, setting fraction to volatile should be enough. I know about that... but i think in this situation it's not a problem, because there is only 1 thread changing fraction, the other is just reading. IMHO, in the worst case, the thread that reads will read an old value... which is alright, since it'll read the right value anyway when the Timer ticks again. I might be wrong though. Cheers, J.V. Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com/ |