changed chain_to_semaphore() to be more fault resistent

This commit is contained in:
hyunghwan.chung 2019-08-24 16:03:17 +00:00
parent c8e22fbd92
commit 87cf4f4b6a
2 changed files with 3 additions and 1 deletions

View File

@ -172,7 +172,7 @@ class System(Apex)
/* TODO: end redo */ /* TODO: end redo */
caller terminate. caller terminate.
//(Processor _processById: 1) resume. <---- i shouldn't do ths. but, this system causes VM assertion failure. fix it.... (Processor _processById: 1) resume. //<---- i shouldn't do ths. but, this system causes VM assertion failure. fix it....
System logNl: '>>>>End of OS signal handler process ' & (thisProcess id) asString. System logNl: '>>>>End of OS signal handler process ' & (thisProcess id) asString.
]. ].

View File

@ -537,6 +537,8 @@ static MOO_INLINE void chain_into_semaphore (moo_t* moo, moo_oop_process_t proc,
/* a process chained to a semaphore cannot get chained to /* a process chained to a semaphore cannot get chained to
* a semaphore again. a process can get chained to a single semaphore * a semaphore again. a process can get chained to a single semaphore
* or a single semaphore group only */ * or a single semaphore group only */
if ((moo_oop_t)proc->sem != moo->_nil) return; /* ignore it if it happens anyway. TODO: is it desirable???? */
MOO_ASSERT (moo, (moo_oop_t)proc->sem == moo->_nil); MOO_ASSERT (moo, (moo_oop_t)proc->sem == moo->_nil);
MOO_ASSERT (moo, (moo_oop_t)proc->sem_wait.prev == moo->_nil); MOO_ASSERT (moo, (moo_oop_t)proc->sem_wait.prev == moo->_nil);
MOO_ASSERT (moo, (moo_oop_t)proc->sem_wait.next == moo->_nil); MOO_ASSERT (moo, (moo_oop_t)proc->sem_wait.next == moo->_nil);