net/can,udp,tcp: add sem destroy for udp/tcp sndsem;

standardize the usage of semphore

Signed-off-by: wangjinjing1 <wangjinjing1@xiaomi.com>
This commit is contained in:
wangjinjing1 2025-01-03 09:57:32 +08:00 committed by Xiang Xiao
parent 8c92be874f
commit 232ef950c6
4 changed files with 12 additions and 4 deletions

View file

@ -163,6 +163,10 @@ void can_free(FAR struct can_conn_s *conn)
can_sendbuffer_notify(conn);
# endif /* CONFIG_NET_SEND_BUFSIZE */
#endif
#if CONFIG_NET_SEND_BUFSIZE > 0
nxsem_destroy(&conn->sndsem);
#endif
/* Free the connection. */

View file

@ -518,10 +518,6 @@ static int can_close(FAR struct socket *psock)
}
#endif
#if CONFIG_NET_SEND_BUFSIZE > 0
nxsem_destroy(&conn->sndsem);
#endif
/* Free the connection structure */
conn->crefs = 0;

View file

@ -887,6 +887,10 @@ void tcp_free(FAR struct tcp_conn_s *conn)
#endif
#if CONFIG_NET_SEND_BUFSIZE > 0
nxsem_destroy(&conn->snd_sem);
#endif
#ifdef CONFIG_NET_TCPBACKLOG
/* Remove any backlog attached to this connection */

View file

@ -647,6 +647,10 @@ void udp_free(FAR struct udp_conn_s *conn)
udp_sendbuffer_notify(conn);
#endif /* CONFIG_NET_SEND_BUFSIZE */
#endif
#if CONFIG_NET_SEND_BUFSIZE > 0
nxsem_destroy(&conn->sndsem);
#endif
/* Free the connection. */