Lines Matching refs:timer

103   // from the TimerThread::mTimers array, so we Cancel this timer to remove
104 // the mTimers element, and return 0 if Cancel in fact disarmed the timer.
108 // timer is not found in the mTimers array -- i.e., when the timer was not
110 // being true here. That can happen if the armed timer is being fired by
112 // the timer thread. If the RemoveTimer call below doesn't find this timer
113 // in the mTimers array, then the last ref to this timer is held manually
117 // The original version of this thread-based timer code kept weak refs from
118 // TimerThread::mTimers, removing this timer's weak ref in the destructor,
122 // method with "is this timer still in the mTimers array once we acquire
124 // that only one thread has its hot little hands on this timer.
126 // Note that both approaches preclude a timer creator, and everyone else
128 // their strong refs without implicitly canceling the timer. Timers need
221 * timer from the timer thread's list.
223 * If we are racing with the timer thread to remove this timer and we lose,
224 * the RemoveTimer call made here will fail to find this timer in the timer
226 * avoid the small overhead in RemoveTimer of locking the timer thread and
227 * checking its list for this timer. It's safe to test mArmed even though
316 // during the callback that we don't end up with the timer in the queue twice.
401 ("[this=%p] Took %dms to fire timer callback\n",
424 nsTimerImpl* timer = NS_STATIC_CAST(nsTimerImpl*, event->owner);
425 if (event->mGeneration != timer->GetGeneration())
439 timer->GetIdle(&idle);
443 gManager->AddIdleTimer(timer);
448 timer->Fire();
455 nsTimerImpl *timer = NS_STATIC_CAST(nsTimerImpl*, event->owner);
456 NS_RELEASE(timer);
478 // number from this timer into the event, so we can avoid firing a timer
488 // If this is a repeating precise timer, we need to calculate the time for
489 // the next timer to fire before we make the callback.
499 NS_WARNING("Dropping timer event because thread is dead");
586 nsresult nsTimerManager::AddIdleTimer(nsITimer* timer)
588 if (!timer)
591 mIdleTimers.AppendElement(timer);
592 NS_ADDREF(timer);
628 nsTimerImpl* timer = new nsTimerImpl();
629 if (timer == nsnull)
631 NS_ADDREF(timer);
633 nsresult rv = timer->InitWithFuncCallback(aCallback, aClosure,
636 NS_RELEASE(timer);
640 *aResult = timer;