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:
wangjinjing1
2025-02-27 10:00:11 +08:00
committed by Xiang Xiao
parent 3bd4748bc3
commit 99584588fc
+9 -1
View File
@@ -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;