Changeset 12908


Ignore:
Timestamp:
Oct 5, 2009, 3:25:39 AM (10 years ago)
Author:
rme
Message:

In unwatch_object(): if some other thread is waiting to handle an
exception, don't unwatch the object and arrange for UNWATCH to return
NIL.

safe_to_unwatch(): new function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/watchpoints/lisp-kernel/x86-exceptions.c

    r12885 r12908  
    37473747}
    37483748
     3749/* If some other thread is waiting to handle an exception, it may
     3750   not be safe to unwatch the object. */
     3751int
     3752safe_to_unwatch(TCR *tcr)
     3753{
     3754  TCR *other;
     3755
     3756  for (other = tcr->next; other != tcr; other = other->next) {
     3757    if (other->xframe) {
     3758      return false;
     3759    }
     3760  }
     3761  return true;
     3762}
     3763
     3764
    37493765/*
    37503766 * We expect the watched object in arg_y, and the new uninitialized
     
    37613777  LispObj *newnode = (LispObj *)untag(new);
    37623778  area *a = area_containing((BytePtr)old);
     3779
     3780  if (safe_to_unwatch(tcr) == false) {
     3781    xpGPR(xp, Iarg_z) = lisp_nil;
     3782    return 0;
     3783  }
    37633784
    37643785  if (a && a->code == AREA_WATCHED) {
Note: See TracChangeset for help on using the changeset viewer.