mirror of
https://github.com/apache/nuttx.git
synced 2026-09-14 14:40:23 +00:00
drivers/net/tun.c: Use critical section instead of semaphore in tun_ifdown()
This commit is contained in:
parent
096f72a365
commit
32a8d09901
1 changed files with 4 additions and 2 deletions
|
|
@ -667,8 +667,9 @@ static int tun_ifup(struct net_driver_s *dev)
|
|||
static int tun_ifdown(struct net_driver_s *dev)
|
||||
{
|
||||
FAR struct tun_device_s *priv = (FAR struct tun_device_s *)dev->d_private;
|
||||
irqstate_t flags;
|
||||
|
||||
tun_lock(priv);
|
||||
flags = enter_critical_section();
|
||||
|
||||
/* Cancel the TX poll timer */
|
||||
|
||||
|
|
@ -677,7 +678,8 @@ static int tun_ifdown(struct net_driver_s *dev)
|
|||
/* Mark the device "down" */
|
||||
|
||||
priv->bifup = false;
|
||||
tun_unlock(priv);
|
||||
|
||||
leave_critical_section(flags);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue