Lines Matching refs:event

51         FastEventQueue(SchedulableEvent event) {
52 mFirst = event;
63 * Do not call this unless there is more than one event
65 * @return first event in the list
68 // Take first event.
70 SchedulableEvent event = mFirst;
71 mFirst = event.mNext;
72 event.mNext = null;
73 return event;
77 * @param event
79 public void add(SchedulableEvent event) {
80 event.mNext = null;
81 mLast.mNext = event;
82 mLast = event;
109 * The timestamp should not be modified when the event is in the
118 * Get an event from the pool.
119 * Always leave at least one event in the pool.
120 * @return event or null
123 SchedulableEvent event = null;
125 event = mEventPool.remove();
127 return event;
133 * @param event
135 public void addEventToPool(SchedulableEvent event) {
137 mEventPool = new FastEventQueue(event);
139 // drop the event. This prevents unbounded memory leaks.
141 mEventPool.add(event);
146 * Add an event to the scheduler. Events with the same time will be
149 * @param event
151 public void add(SchedulableEvent event) {
153 FastEventQueue list = mEventBuffer.get(event.getTimestamp());
157 list = new FastEventQueue(event);
158 mEventBuffer.put(event.getTimestamp(), list);
159 // If the event we added is earlier than the previous earliest
160 // event then notify any threads waiting for the next event.
161 if (event.getTimestamp() < lowestTime) {
165 list.add(event);
171 SchedulableEvent event;
177 event = list.remove();
178 return event;
185 * @return next event or null if none ready
188 SchedulableEvent event = null;
194 event = removeNextEventLocked(lowestTime);
198 // Log.i(TAG, "getNextEvent: event = " + event);
199 return event;
203 * Return the next available event or wait until there is an event ready to
207 * @return event
211 SchedulableEvent event = null;
220 event = removeNextEventLocked(lowestTime);
223 // Figure out how long to sleep until next event.
237 return event;
241 // Replace our event buffer with a fresh empty one