1 // This file is part of Golly.
2 // See docs/License.html for the copyright notice.
3 
4 #include "lifepoll.h"
5 #include "util.h"
lifepoll()6 lifepoll::lifepoll() {
7   interrupted = 0 ;
8   calculating = 0 ;
9   countdown = POLLINTERVAL ;
10 }
checkevents()11 int lifepoll::checkevents() {
12   return 0 ;
13 }
inner_poll()14 int lifepoll::inner_poll() {
15   // AKT: bailIfCalculating() ;
16   if (isCalculating()) {
17     // AKT: nicer to simply ignore user event
18     // lifefatal("recursive poll called.") ;
19     return interrupted ;
20   }
21   countdown = POLLINTERVAL ;
22   calculating++ ;
23   if (!interrupted)
24     interrupted = checkevents() ;
25   calculating-- ;
26   return interrupted ;
27 }
bailIfCalculating()28 void lifepoll::bailIfCalculating() {
29   if (isCalculating()) {
30     // AKT: nicer not to call lifefatal
31     // lifefatal("recursive poll called.") ;
32     lifewarning("Illegal operation while calculating.") ;
33     interrupted = 1 ;
34   }
35 }
updatePop()36 void lifepoll::updatePop() {}
37 lifepoll default_poller ;
38