diff options
Diffstat (limited to 'Mac')
-rw-r--r-- | Mac/Python/macglue.c | 9 |
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 |