Changeset 11115


Ignore:
Timestamp:
Oct 17, 2008, 10:45:01 AM (11 years ago)
Author:
gb
Message:

Always queue an APC when interrupting a thread that's in foreign
code: we can't usably tell whether or not the thread's blocked,
so cause some spurious EINTRs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/thread_manager.c

    r11095 r11115  
    110110          CancelIo(pending->h);
    111111        }
    112       } else {
    113         QueueUserAPC(nullAPC, hthread, 0);
    114112      }
    115113    }
    116 
     114    QueueUserAPC(nullAPC, hthread, 0);
    117115    ResumeThread(hthread);
    118116    return 0;
     
    17621760#ifdef WIN_64
    17631761          *pcontext = * (CONTEXT *)(pcontext->Rcx);
     1762#else
     1763          fprintf(stderr, "missing win32 suspend code, case (1)\n");
    17641764#endif
    17651765        } else {
     
    17781778#else
    17791779#warning need context setup for win32
     1780          fprintf(stderr, "missing win32 suspend code, case (2)\n");
    17801781#endif
    17811782        }
     
    17871788           or on the tstack ... we're just executing lisp code.  Otherwise,
    17881789           we got an exception while executing lisp code, but haven't
    1789            yet entered the handler yet (still in Windows exception glue
     1790           entered the handler yet (still in Windows exception glue
    17901791           or switching stacks or something.)  In the latter case, we
    17911792           basically want to get to he handler and have it notice
     
    19161917    HANDLE hthread = (HANDLE)(tcr->osid);
    19171918
    1918     if (context == NULL) {
    1919       Bug(NULL, "no suspend_context for TCR = 0x" LISP, (natural)tcr);
    1920     }
    1921     tcr->suspend_context = NULL;
    1922     SetThreadContext(hthread,context);
    1923     rc = ResumeThread(hthread);
    1924     if (rc == -1) {
    1925       wperror("ResumeThread");
    1926       return false;
    1927     }
    1928     return true;
     1919    if (context) {
     1920      tcr->suspend_context = NULL;
     1921      SetThreadContext(hthread,context);
     1922      rc = ResumeThread(hthread);
     1923      if (rc == -1) {
     1924        wperror("ResumeThread");
     1925        return false;
     1926      }
     1927      return true;
     1928    }
    19291929  }
    19301930  return false;
Note: See TracChangeset for help on using the changeset viewer.