4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-16 07:49:30 +08:00
Grissiom 1ebf7b5196 [Netif] Fix the eth_tx_msg protection
The ethernetif use semaphore netif->tx_ack to protect the local variable
`struct eth_tx_msg msg` in function `ethernetif_linkoutput`. But the
function could be called in multiple context: LwIP "tcpip" thread, "erx"
thread(on linkup) and any user thread that call `udp_sendto`. So the
global semaphore protection is not sufficient. It could only wakeup the
top priority waiting thread instead of the thread that owns the `msg`
and may result the `msg` next in the mailbox got destructed.

So to use a `rt_completion` within the `struct eth_tx_msg` and
synchronize on that. This could deal the ownership issue in an easy way.
2021-09-11 13:11:57 +08:00
..
2021-09-01 09:28:16 -04:00
2021-09-06 13:27:40 +08:00
2021-03-08 18:19:04 +08:00
2021-09-11 13:11:57 +08:00
2021-03-08 18:19:04 +08:00