Mercurial > emacs
comparison src/atimer.c @ 28119:98625ad8a015
(cancel_atimer): Break out of the loop as soon as timer
has been found. Fix bug not computing timer's predecessor.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Sun, 12 Mar 2000 17:01:02 +0000 |
parents | 81d5641c8b04 |
children | 2722b6b5400d |
comparison
equal
deleted
inserted
replaced
28118:864231b74663 | 28119:98625ad8a015 |
---|---|
174 { | 174 { |
175 struct atimer *t, *prev; | 175 struct atimer *t, *prev; |
176 struct atimer **list = i ? &stopped_atimers : &atimers; | 176 struct atimer **list = i ? &stopped_atimers : &atimers; |
177 | 177 |
178 /* See if TIMER is active or stopped. */ | 178 /* See if TIMER is active or stopped. */ |
179 for (t = *list, prev = 0; t && t != timer; t = t->next) | 179 for (t = *list, prev = NULL; t && t != timer; prev = t, t = t->next) |
180 ; | 180 ; |
181 | 181 |
182 /* If it is, take it off the its list, and put in on the | 182 /* If it is, take it off the its list, and put in on the |
183 free-list. We don't bother to arrange for setting a | 183 free-list. We don't bother to arrange for setting a |
184 different alarm time, since a too early one doesn't hurt. */ | 184 different alarm time, since a too early one doesn't hurt. */ |
189 else | 189 else |
190 *list = t->next; | 190 *list = t->next; |
191 | 191 |
192 t->next = free_atimers; | 192 t->next = free_atimers; |
193 free_atimers = t; | 193 free_atimers = t; |
194 break; | |
194 } | 195 } |
195 } | 196 } |
196 | 197 |
197 UNBLOCK_ATIMERS; | 198 UNBLOCK_ATIMERS; |
198 } | 199 } |