Changeset 15142


Ignore:
Timestamp:
Dec 16, 2011, 11:43:44 PM (8 years ago)
Author:
gb
Message:

Back out of most of the changes in r15131, which inadvertently
included some experimental code.

Relative to r15130, this version of the file contains only
the following changes:

get_tcr(): on Win32, check the linear field of the presumed TCR
address, don't just return a (possibly uninitialized) address in
the TEB.

dequeue_tcr(): set tcr->linear to NULL on x8632, too.

File:
1 edited

Legend:

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

    r15131 r15142  
    8787  /* What if the suspend count is > 1 at this point ?  I don't think
    8888     that that matters, but I'm not sure */
    89   pcontext->ContextFlags = CONTEXT_FULL;
     89  pcontext->ContextFlags = CONTEXT_ALL;
    9090  rc = GetThreadContext(hthread, pcontext);
    9191  if (rc == 0) {
     
    20202020      return false;
    20212021    }
    2022     pcontext->ContextFlags = CONTEXT_FULL;
     2022    pcontext->ContextFlags = CONTEXT_ALL;
    20232023    rc = GetThreadContext(hthread, pcontext);
    20242024    if (rc == 0) {
     
    20272027    where = (pc)(xpPC(pcontext));
    20282028
    2029     if ((where >= restore_windows_context_start) &&
    2030         (where < restore_windows_context_end) &&
    2031         (tcr->valence != TCR_STATE_LISP)) {
    2032       Bug(NULL, "Forgot about this case ...");
    2033     }
    20342029    if (tcr->valence == TCR_STATE_LISP) {
    20352030      if ((where >= restore_windows_context_start) &&
     
    20662061          ResumeThread(hthread);
    20672062          SEM_WAIT_FOREVER(TCR_AUX(tcr)->suspend);
    2068           pcontext = NULL;
     2063          SuspendThread(hthread);
     2064          /* The thread is either waiting for its resume semaphore to
     2065             be signaled or is about to wait.  Signal it now, while
     2066             the thread's suspended. */
     2067          SEM_RAISE(TCR_AUX(tcr)->resume);
     2068          pcontext->ContextFlags = CONTEXT_ALL;
     2069          GetThreadContext(hthread, pcontext);
    20692070        }
    20702071      }
     
    21932194    HANDLE hthread = (HANDLE)(TCR_AUX(tcr)->osid);
    21942195
    2195 
    2196     TCR_AUX(tcr)->suspend_context = NULL;
    21972196    if (context) {
    2198       if (tcr->valence == TCR_STATE_LISP) {
    2199         rc = SetThreadContext(hthread,context);
    2200         if (! rc) {
    2201           Bug(NULL,"SetThreadContext");
    2202           return false;
    2203         }
    2204       }
     2197      context->ContextFlags = CONTEXT_ALL;
     2198      TCR_AUX(tcr)->suspend_context = NULL;
     2199      SetThreadContext(hthread,context);
    22052200      rc = ResumeThread(hthread);
    22062201      if (rc == -1) {
    2207         Bug(NULL,"ResumeThread");
     2202        wperror("ResumeThread");
    22082203        return false;
    22092204      }
    2210       return true;
    2211     } else {
    2212       SEM_RAISE(TCR_AUX(tcr)->resume);
    22132205      return true;
    22142206    }
Note: See TracChangeset for help on using the changeset viewer.