Avoid rereading our volatile variable because it could result in multithread
weirdness. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1934 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -100,7 +100,8 @@ public abstract class Interval
|
|||||||
public final void schedule (long initialDelay, long repeatDelay)
|
public final void schedule (long initialDelay, long repeatDelay)
|
||||||
{
|
{
|
||||||
cancel();
|
cancel();
|
||||||
TimerTask task = _task = new IntervalTask();
|
TimerTask task = new IntervalTask();
|
||||||
|
_task = task;
|
||||||
|
|
||||||
if (repeatDelay == 0L) {
|
if (repeatDelay == 0L) {
|
||||||
_timer.schedule(task, initialDelay);
|
_timer.schedule(task, initialDelay);
|
||||||
|
|||||||
Reference in New Issue
Block a user