Changeset 454


Ignore:
Timestamp:
Feb 1, 2004, 10:09:49 AM (21 years ago)
Author:
Gary Byers
Message:

Experimental change, to defer tcr cleanup.

Location:
trunk/ccl/lisp-kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lisp-kernel/constants.h

    r18 r454  
    503503#define TCR_FLAG_BIT_FOREIGN fixnumshift
    504504#define TCR_FLAG_BIT_AWAITING_PRESET (fixnumshift+1)
     505#define TCR_FLAG_BIT_SHUTDOWN_REQUEST (fixnumshift+2)
    505506
    506507#define TCR_STATE_FOREIGN (1)
  • trunk/ccl/lisp-kernel/thread_manager.c

    r147 r454  
    456456  }
    457457 
     458  if (tcr->flags & (1<<TCR_FLAG_BIT_SHUTDOWN_REQUEST)) {
     459    tcr->flags &= ~(1<<TCR_FLAG_BIT_SHUTDOWN_REQUEST);
     460
    458461#ifdef DARWIN
    459   darwin_exception_cleanup(tcr);
    460 #endif
    461  
    462   vs = tcr->vs_area;
    463   tcr->vs_area = NULL;
    464   ts = tcr->ts_area;
    465   tcr->ts_area = NULL;
    466   cs = tcr->cs_area;
    467   tcr->cs_area = NULL;
    468   if (vs) {
    469     condemn_area(vs);
    470   }
    471   if (ts) {
    472     condemn_area(ts);
    473   }
    474   if (cs) {
    475     condemn_area(cs);
    476   }
    477   destroy_semaphore(&tcr->suspend);
    478   destroy_semaphore(&tcr->resume);
    479   destroy_semaphore(&tcr->reset_completion);
    480   destroy_semaphore(&tcr->activate);
    481   tcr->osid = 0;
     462    darwin_exception_cleanup(tcr);
     463#endif
     464 
     465    vs = tcr->vs_area;
     466    tcr->vs_area = NULL;
     467    ts = tcr->ts_area;
     468    tcr->ts_area = NULL;
     469    cs = tcr->cs_area;
     470    tcr->cs_area = NULL;
     471    if (vs) {
     472      condemn_area(vs);
     473    }
     474    if (ts) {
     475      condemn_area(ts);
     476    }
     477    if (cs) {
     478      condemn_area(cs);
     479    }
     480    destroy_semaphore(&tcr->suspend);
     481    destroy_semaphore(&tcr->resume);
     482    destroy_semaphore(&tcr->reset_completion);
     483    destroy_semaphore(&tcr->activate);
     484    tcr->osid = 0;
     485  } else {
     486    tcr->flags |= (1<<TCR_FLAG_BIT_SHUTDOWN_REQUEST);
     487    tsd_set(lisp_global(TCR_KEY), tcr);
     488  }
    482489}
    483490
Note: See TracChangeset for help on using the changeset viewer.