[fix] change from enter critical area into disable interrupt.
This commit is contained in:
parent
233e1cd8bc
commit
2b549d93c8
|
@ -638,6 +638,7 @@ static void eth_rx_thread_entry(void* parameter)
|
|||
{
|
||||
if (rt_mb_recv(ð_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)
|
||||
|
|
|
@ -687,6 +687,7 @@ static void eth_rx_thread_entry(void* parameter)
|
|||
{
|
||||
if (rt_mb_recv(ð_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)
|
||||
|
|
|
@ -689,6 +689,7 @@ static void eth_rx_thread_entry(void* parameter)
|
|||
{
|
||||
if (rt_mb_recv(ð_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)
|
||||
|
|
Loading…
Reference in New Issue