mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
net: replace net_sem*wait with conn_dev_sem*wait to simplify code logic
optimize the current code format according to the previous net_xxx_wait implementation to reduce multiple calls of similar code Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
committed by
Alan C. Assis
parent
aee7ea0d7d
commit
8f41613374
@@ -256,11 +256,12 @@ devif_callback_alloc(FAR struct net_driver_s *dev,
|
||||
*/
|
||||
|
||||
/* Note: dev->d_flags may be asynchronously changed by netdev_ifdown()
|
||||
* (in net/netdev/netdev_ioctl.c). Nevertheless, net_lock() / net_unlock()
|
||||
* are not required in netdev_ifdown() to prevent dev->d_flags from
|
||||
* asynchronous change here. There is not an issue because net_lock() and
|
||||
* net_unlock() present inside of devif_dev_event(). That should be enough
|
||||
* to de-allocate connection callbacks reliably on NETDEV_DOWN event.
|
||||
* (in net/netdev/netdev_ioctl.c). Nevertheless, netdev_lock() /
|
||||
* netdev_unlock() are not required in netdev_ifdown() to prevent
|
||||
* dev->d_flags from asynchronous change here. There is not an issue
|
||||
* because netdev_lock() and netdev_unlock() present inside of
|
||||
* devif_dev_event(). That should be enough to de-allocate connection
|
||||
* callbacks reliably on NETDEV_DOWN event.
|
||||
*/
|
||||
|
||||
if (dev && !netdev_verify(dev))
|
||||
|
||||
Reference in New Issue
Block a user