Code: Select all
chMBFetch(&mb, (msg_t *)p, TIME_INFINITE);
where `p` is actually a pointer to something in a memory pool. However, as I observed, this line seems to block all other threads. I am not sure whether it is expected. It is possible to use `TIME_IMMEDIATE` and then insert a manual delay, but I don't like that solution.
Maybe mailbox is not the best way to do it, but I can't think of other methods for now.
BTW, how should I see whether a certain action will yield the execution to other threads? I know event waiting yields, sleeps also does, but what about other things, like sdPutTimeout and such?