mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
net/can: modify net_unlock location before txnotify for can_sendmsg_buffered.c
Release the lock early to reduce the number of thread switches. Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
This commit is contained in:
@@ -387,12 +387,20 @@ ssize_t can_sendmsg(FAR struct socket *psock, FAR struct msghdr *msg,
|
||||
conn->sndcb->priv = (FAR void *)conn;
|
||||
conn->sndcb->event = psock_send_eventhandler;
|
||||
|
||||
/* unlock */
|
||||
|
||||
net_unlock();
|
||||
|
||||
/* Notify the device driver that new TX data is available. */
|
||||
|
||||
netdev_txnotify_dev(dev);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* unlock */
|
||||
|
||||
net_unlock();
|
||||
net_unlock();
|
||||
}
|
||||
|
||||
return msg->msg_iov->iov_len;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user