* sigproc.cc (remove_proc): Don't terminate the currently executing thread.

This commit is contained in:
Christopher Faylor
2011-11-29 15:34:49 +00:00
parent d1fc77322f
commit 480b13a37a
9 changed files with 219 additions and 136 deletions

View File

@@ -70,18 +70,22 @@ cygheap_fixup_in_child (bool execed)
{
cygheap->hooks.next = NULL;
cygheap->user_heap.base = NULL; /* We can allocate the heap anywhere */
/* Walk the allocated memory chain looking for orphaned memory from
previous execs */
for (_cmalloc_entry *rvc = cygheap->chain; rvc; rvc = rvc->prev)
{
cygheap_entry *ce = (cygheap_entry *) rvc->data;
if (!rvc->ptr || rvc->b >= NBUCKETS || ce->type <= HEAP_1_START)
continue;
else if (ce->type < HEAP_1_MAX)
ce->type += HEAP_1_MAX; /* Mark for freeing after next exec */
else
_cfree (ce); /* Marked by parent for freeing in child */
}
}
/* Walk the allocated memory chain looking for orphaned memory from
previous execs or forks */
for (_cmalloc_entry *rvc = cygheap->chain; rvc; rvc = rvc->prev)
{
cygheap_entry *ce = (cygheap_entry *) rvc->data;
if (!rvc->ptr || rvc->b >= NBUCKETS || ce->type <= HEAP_1_START)
continue;
else if (ce->type > HEAP_2_MAX)
_cfree (ce); /* Marked for freeing in any child */
else if (!execed)
continue;
else if (ce->type > HEAP_1_MAX)
_cfree (ce); /* Marked for freeing in execed child */
else
ce->type += HEAP_1_MAX; /* Mark for freeing after next exec */
}
}