jdk/src/java.desktop/share/classes/javax/swing/Timer.java
changeset 32865 f9cb6e427f9e
parent 31164 a61c96d50ddd
equal deleted inserted replaced
32864:2a338536e642 32865:f9cb6e427f9e
   170     // notify is used to indicate if the ActionListener can be notified, when
   170     // notify is used to indicate if the ActionListener can be notified, when
   171     // the Runnable is processed if this is true it will notify the listeners.
   171     // the Runnable is processed if this is true it will notify the listeners.
   172     // notify is set to true when the Timer fires and the Runnable is queued.
   172     // notify is set to true when the Timer fires and the Runnable is queued.
   173     // It will be set to false after notifying the listeners (if coalesce is
   173     // It will be set to false after notifying the listeners (if coalesce is
   174     // true) or if the developer invokes stop.
   174     // true) or if the developer invokes stop.
   175     private transient final AtomicBoolean notify = new AtomicBoolean(false);
   175     private final transient AtomicBoolean notify = new AtomicBoolean(false);
   176 
   176 
   177     private volatile int     initialDelay, delay;
   177     private volatile int     initialDelay, delay;
   178     private volatile boolean repeats = true, coalesce = true;
   178     private volatile boolean repeats = true, coalesce = true;
   179 
   179 
   180     private transient final Runnable doPostEvent;
   180     private final transient Runnable doPostEvent;
   181 
   181 
   182     private static volatile boolean logTimers;
   182     private static volatile boolean logTimers;
   183 
   183 
   184     private transient final Lock lock = new ReentrantLock();
   184     private final transient Lock lock = new ReentrantLock();
   185 
   185 
   186     // This field is maintained by TimerQueue.
   186     // This field is maintained by TimerQueue.
   187     // eventQueued can also be reset by the TimerQueue, but will only ever
   187     // eventQueued can also be reset by the TimerQueue, but will only ever
   188     // happen in applet case when TimerQueues thread is destroyed.
   188     // happen in applet case when TimerQueues thread is destroyed.
   189     // access to this field is synchronized on getLock() lock.
   189     // access to this field is synchronized on getLock() lock.