rpmsg_scoket: handle race condition on ept_cb RPMSG_SOCKET_CMD_SYNC
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
d0486be2a3
commit
be70ab2ebb
|
@ -296,9 +296,11 @@ static int rpmsg_socket_ept_cb(FAR struct rpmsg_endpoint *ept,
|
|||
|
||||
if (head->cmd == RPMSG_SOCKET_CMD_SYNC)
|
||||
{
|
||||
rpmsg_socket_lock(&conn->recvlock);
|
||||
conn->sendsize = head->size;
|
||||
conn->psock->s_flags |= _SF_CONNECTED;
|
||||
_SO_SETERRNO(conn->psock, OK);
|
||||
rpmsg_socket_unlock(&conn->recvlock);
|
||||
rpmsg_socket_post(&conn->sendsem);
|
||||
rpmsg_socket_pollnotify(conn, POLLOUT);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue