[fix] change from enter critical area into disable interrupt.

This commit is contained in:
liuxianliang 2021-04-06 10:46:31 +08:00
parent 233e1cd8bc
commit 2b549d93c8
3 changed files with 9 additions and 6 deletions

View File

@ -638,6 +638,7 @@ static void eth_rx_thread_entry(void* parameter)
{
if (rt_mb_recv(&eth_rx_thread_mb, (rt_ubase_t*)&device, RT_WAITING_FOREVER) == RT_EOK)
{
rt_base_t level;
struct pbuf *p;
/* check link status */
@ -657,10 +658,10 @@ static void eth_rx_thread_entry(void* parameter)
netifapi_netif_set_link_down(device->netif);
}
rt_enter_critical();
level = rt_hw_interrupt_disable();
/* 'rx_notice' will be modify in the interrupt or here */
device->rx_notice = RT_FALSE;
rt_exit_critical();
rt_hw_interrupt_enable(level);
/* receive all of buffer */
while(1)

View File

@ -687,6 +687,7 @@ static void eth_rx_thread_entry(void* parameter)
{
if (rt_mb_recv(&eth_rx_thread_mb, (rt_ubase_t *)&device, RT_WAITING_FOREVER) == RT_EOK)
{
rt_base_t level;
struct pbuf *p;
/* check link status */
@ -706,10 +707,10 @@ static void eth_rx_thread_entry(void* parameter)
netifapi_netif_set_link_down(device->netif);
}
rt_enter_critical();
level = rt_hw_interrupt_disable();
/* 'rx_notice' will be modify in the interrupt or here */
device->rx_notice = RT_FALSE;
rt_exit_critical();
rt_hw_interrupt_enable(level);
/* receive all of buffer */
while(1)

View File

@ -689,6 +689,7 @@ static void eth_rx_thread_entry(void* parameter)
{
if (rt_mb_recv(&eth_rx_thread_mb, (rt_ubase_t *)&device, RT_WAITING_FOREVER) == RT_EOK)
{
rt_base_t level;
struct pbuf *p;
/* check link status */
@ -708,10 +709,10 @@ static void eth_rx_thread_entry(void* parameter)
netifapi_netif_set_link_down(device->netif);
}
rt_enter_critical();
level = rt_hw_interrupt_disable();
/* 'rx_notice' will be modify in the interrupt or here */
device->rx_notice = RT_FALSE;
rt_exit_critical();
rt_hw_interrupt_enable(level);
/* receive all of buffer */
while(1)