Changeset 826


Ignore:
Timestamp:
Jun 5, 2004, 11:00:37 PM (20 years ago)
Author:
Gary Byers
Message:

New post-gc freeing mechanism (suspened thread may own malloc lock.)
Similar mechanism for TCR cleanup.

File:
1 edited

Legend:

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

    r673 r826  
    115115{
    116116  destroy_semaphore((void **)&m->signal);
    117   free(m->malloced_ptr);
     117  postGCfree((void *)(m->malloced_ptr));
    118118}
    119119
     
    862862#endif
    863863
     864TCR *freed_tcrs = NULL;
     865
     866void
     867enqueue_freed_tcr (TCR *tcr)
     868{
     869  tcr->next = freed_tcrs;
     870  freed_tcrs = tcr;
     871}
     872
     873void
     874free_freed_tcrs ()
     875{
     876  TCR *current, *next;
     877
     878  for (current = freed_tcrs; current; current = next) {
     879    next = current->next;
     880    free(current);
     881  }
     882  freed_tcrs = NULL;
     883}
     884
    864885void
    865886suspend_other_threads()
     
    886907      if ((other->osid == 0))  {
    887908        dequeue_tcr(other);
    888         free(other);
     909        enqueue_freed_tcr(other);
    889910      }
    890911    }
     
    899920    resume_tcr(other);
    900921  }
     922  free_freed_tcrs();
    901923  UNLOCK(lisp_global(AREA_LOCK), current);
    902924  UNLOCK(lisp_global(TCR_LOCK), current);
Note: See TracChangeset for help on using the changeset viewer.