One thread is doing
Code: Select all
chMBPostTimeout(&this->m_auxmsg_mbox, (msg_t)msg, TIME_IMMEDIATE);(n.b: msg is a pointer to a message allocated from a memory pool)
Another thread is blocking on the mailbox:
Code: Select all
auto result = chMBFetchTimeout(&this->m_auxmsg_mbox, (msg_t *) &m, TIME_MS2I(10));If the timeout occurs before the post, the post causes a chSysHalt via chThdDoDequeueNextI, specifically due to the line
Code: Select all
chDbgAssert(tp->state == CH_STATE_QUEUED, "invalid state");However, if the timeout is [font=Courier New]TIME_IMMEDIATE[/font], the crash doesn't occur.
I should also note that even if the timeout is raised above the amount of time the posting thread takes, the message never comes through.
Am I somehow misusing message-boxes entirely? Any idea what's going on?