some experimental code in terminate_process() to handle IO semaphores properly
This commit is contained in:
parent
f6d7098744
commit
b96d977234
@ -734,6 +734,26 @@ static void terminate_process (moo_t* moo, moo_oop_process_t proc)
|
|||||||
if ((moo_oop_t)proc->sem != moo->_nil)
|
if ((moo_oop_t)proc->sem != moo->_nil)
|
||||||
{
|
{
|
||||||
unchain_from_semaphore (moo, proc);
|
unchain_from_semaphore (moo, proc);
|
||||||
|
|
||||||
|
/* [EXPERIMENTAL] =============================== */
|
||||||
|
if (MOO_CLASSOF(moo, proc->sem) == moo->_semaphore_group)
|
||||||
|
{
|
||||||
|
/* TODO: */
|
||||||
|
if (MOO_OOP_TO_SMOOI((moo_oop_semaphore_group_t)proc->sem) > 0)
|
||||||
|
{
|
||||||
|
MOO_ASSERT (moo, moo->sem_io_wait_count > 0);
|
||||||
|
moo->sem_io_wait_count--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (((moo_oop_semaphore_t)proc->sem)->subtype == MOO_SMOOI_TO_OOP(MOO_SEMAPHORE_SUBTYPE_IO))
|
||||||
|
{
|
||||||
|
MOO_ASSERT (moo, moo->sem_io_wait_count > 0);
|
||||||
|
moo->sem_io_wait_count--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* =============================== */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* when terminated, clear it from the pid table and set the process id to a negative number */
|
/* when terminated, clear it from the pid table and set the process id to a negative number */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user