summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1997-02-20 15:23:18 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1997-02-20 15:23:18 (GMT)
commit7e9440408127990b796c4a325cc0c0ee27a1fe5e (patch)
tree766cf6d3cd80020df973dc5c05689878b9c72eaa /Mac
parent4f27a55e800927c42625f66a5254e1a60062088b (diff)
downloadcpython-7e9440408127990b796c4a325cc0c0ee27a1fe5e.zip
cpython-7e9440408127990b796c4a325cc0c0ee27a1fe5e.tar.gz
cpython-7e9440408127990b796c4a325cc0c0ee27a1fe5e.tar.bz2
Only go into eventloop/interrupt check 10 times per second
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Python/macglue.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c
index e2ca494..6fc1e99 100644
--- a/Mac/Python/macglue.c
+++ b/Mac/Python/macglue.c
@@ -351,11 +351,20 @@ scan_event_queue(flush)
}
}
+#define TICKCOUNT 6
+
int
PyOS_InterruptOccurred()
{
+ static unsigned long nextticktime;
+ unsigned long curticktime;
+
if (PyMac_DoYieldEnabled < 0)
return 0;
+ curticktime = (unsigned long)LMGetTicks();
+ if ( curticktime < nextticktime )
+ return 0;
+ nextticktime = curticktime + TICKCOUNT;
#ifdef THINK_C
scan_event_queue(1);
#endif