mirror of
https://github.com/ep00ch/lwip-contrib-mac.git
synced 2024-06-10 18:29:27 +00:00
Fix sys_mbox_post. Could cause threads to hang waiting for a mbox forever
This commit is contained in:
parent
14f251daee
commit
0d7a60bb96
|
@ -78,11 +78,22 @@ void sys_mbox_free(sys_mbox_t mbox)
|
|||
cyg_mempool_var_free(var_mempool_h,(void*)mbox);
|
||||
}
|
||||
|
||||
/*
|
||||
* cyg_mbox_put should not be passed a NULL otherwise the cyg_mbox_get will not
|
||||
* know if it's real data or error condition. But lwIP does pass NULL on occasion
|
||||
* in cases when maybe using a semaphore would be better. So this dummy_msg replaces
|
||||
* NULL data
|
||||
*/
|
||||
|
||||
int dummy_msg = 1;
|
||||
|
||||
/*
|
||||
* Post data to a mbox.
|
||||
*/
|
||||
void sys_mbox_post(sys_mbox_t mbox, void *data)
|
||||
{
|
||||
if (!data)
|
||||
data = &dummy_msg;
|
||||
while (cyg_mbox_put(mbox,data) == false);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user