debugging semaphore handling

This commit is contained in:
hyunghwan.chung 2019-08-30 08:42:21 +00:00
parent 584e7f121e
commit d9ad1a7804

View File

@ -643,6 +643,20 @@ static void terminate_process (moo_t* moo, moo_oop_process_t proc)
}
MOO_LOG0 (moo, MOO_LOG_IC | MOO_LOG_DEBUG, "\n");
}
if (moo->sem_io_wait_count > 0)
{
moo_ooi_t io_handle;
MOO_LOG0 (moo, MOO_LOG_IC | MOO_LOG_DEBUG, "IO Semaphores:");
for (io_handle = 0; io_handle < moo->sem_io_map_capa; io_handle++)
{
if (moo->sem_io_map[io_handle] >= 0)
{
MOO_LOG1 (moo, MOO_LOG_IC | MOO_LOG_DEBUG, " %zd", io_handle);
}
}
MOO_LOG0 (moo, MOO_LOG_IC | MOO_LOG_DEBUG, "\n");
}
}
else
{
@ -1381,6 +1395,15 @@ static int delete_sem_from_sem_io_tuple (moo_t* moo, moo_oop_semaphore_t sem, in
sem->u.io.type = moo->_nil;
moo->sem_io_count--;
/* ****************************************** */
if (sem->waiting.first != moo->_nil)
{
/* TODO: debug further.... */
MOO_DEBUG1 (moo, "decrementing 44 seio_io_wait_count. IO %zd\n", io_handle);
moo->sem_io_wait_count--;
}
/* ****************************************** */
if ((moo_oop_t)sem->group != moo->_nil)
{
moo_ooi_t count;