From: Chris Hanson Date: Thu, 2 Jan 1997 07:07:19 +0000 (+0000) Subject: Rearrange the code that sets memtop to trigger an interrupt. I have a X-Git-Tag: 20090517-FFI~5280 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=aad6a1660f5fa31cf76c4dba940622eccaa121be;p=mit-scheme.git Rearrange the code that sets memtop to trigger an interrupt. I have a strong suspicion that these timer interrupts run in a separate thread under NT. If so, this is a really dangerous thing to be doing without synchronization. This rearrangement will minimize the window in which problems can occur. --- diff --git a/v7/src/microcode/ntutl/scheme16.c b/v7/src/microcode/ntutl/scheme16.c index b248c2ee1..c935cb50f 100644 --- a/v7/src/microcode/ntutl/scheme16.c +++ b/v7/src/microcode/ntutl/scheme16.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: scheme16.c,v 1.9 1997/01/01 22:58:15 cph Exp $ +$Id: scheme16.c,v 1.10 1997/01/02 07:07:13 cph Exp $ Copyright (c) 1993-97 Massachusetts Institute of Technology @@ -355,11 +355,11 @@ scheme_asynctimer (void) if (((INTERRUPT_CODE (scm_timer)) & (INTERRUPT_MASK (scm_timer))) != 0L) { + (MEMTOP (scm_timer)) = ((unsigned long) -1L); PostMessage ((scm_timer -> window), (scm_timer -> interrupt_message), ((WPARAM) 0), ((LPARAM) 0)); - (MEMTOP (scm_timer)) = ((unsigned long) -1L); } (CATATONIA_COUNTER (scm_timer)) += 1L; if (((CATATONIA_COUNTER (scm_timer)) > (CATATONIA_LIMIT (scm_timer))) @@ -367,11 +367,11 @@ scheme_asynctimer (void) { if ((CATATONIA_FLAG (scm_timer)) == 0L) { + (CATATONIA_FLAG (scm_timer)) = 1L; PostMessage ((scm_timer -> window), (scm_timer -> catatonia_message), ((WPARAM) 0), ((LPARAM) 0)); - (CATATONIA_FLAG (scm_timer)) = 1L; } (CATATONIA_COUNTER (scm_timer)) = 0L; } diff --git a/v7/src/microcode/ntutl/scheme32.c b/v7/src/microcode/ntutl/scheme32.c index d75d1d3bb..8490ffacc 100644 --- a/v7/src/microcode/ntutl/scheme32.c +++ b/v7/src/microcode/ntutl/scheme32.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: scheme32.c,v 1.12 1997/01/01 22:58:18 cph Exp $ +$Id: scheme32.c,v 1.13 1997/01/02 07:07:19 cph Exp $ Copyright (c) 1993-97 Massachusetts Institute of Technology @@ -160,13 +160,13 @@ win32_nt_timer_tick (UINT wID, UINT wMsg, DWORD dwUser, DWORD dw1, DWORD dw2) (INTERRUPT_CODE (scm_timer)) |= (scm_timer -> bit_mask); if (((INTERRUPT_CODE (scm_timer)) & (INTERRUPT_MASK (scm_timer))) != 0L) { + (MEMTOP (scm_timer)) = ((unsigned long) -1L); /* Post an interrupt message to the window. This forces it to wake up and exit MsgWaitForMultipleObjects if needed. */ PostMessage ((scm_timer -> window), (scm_timer -> interrupt_message), ((WPARAM) 0), ((LPARAM) 0)); - (MEMTOP (scm_timer)) = ((unsigned long) -1L); } (CATATONIA_COUNTER (scm_timer)) += 1L; if (((CATATONIA_COUNTER (scm_timer)) > (CATATONIA_LIMIT (scm_timer))) @@ -174,11 +174,11 @@ win32_nt_timer_tick (UINT wID, UINT wMsg, DWORD dwUser, DWORD dw1, DWORD dw2) { if ((CATATONIA_FLAG (scm_timer)) == 0L) { + (CATATONIA_FLAG (scm_timer)) = 1L; PostMessage ((scm_timer -> window), (scm_timer -> catatonia_message), ((WPARAM) 0), ((LPARAM) 0)); - (CATATONIA_FLAG (scm_timer)) = 1L; } (CATATONIA_COUNTER (scm_timer)) = 0L; }