mirror of
https://github.com/apache/nuttx.git
synced 2026-10-19 04:43:03 +00:00
net/netdev: separate netdev_list_lock from net_lock
use netdev_list_lock to protect all network card traversal, registration, and deregistration operations. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
906279e37a
commit
0af74a54bb
12 changed files with 92 additions and 29 deletions
|
|
@ -63,7 +63,7 @@ FAR struct net_driver_s *netdev_default(void)
|
|||
|
||||
/* Examine each registered network device */
|
||||
|
||||
net_lock();
|
||||
netdev_list_lock();
|
||||
for (dev = g_netdevices; dev; dev = dev->flink)
|
||||
{
|
||||
/* Is the interface in the "up" state? */
|
||||
|
|
@ -84,6 +84,6 @@ FAR struct net_driver_s *netdev_default(void)
|
|||
}
|
||||
}
|
||||
|
||||
net_unlock();
|
||||
netdev_list_unlock();
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue