Skip to content

Commit 263c831

Browse files
committed
Fix deadlock in socket code
Fix a deadlock that was introduced in 555745c and that happens on platforms without recursive locks (e.g. esp32) by removing an unnessary lock in `socket_recv`. Signed-off-by: Paul Guyot <pguyot@kallisys.net>
1 parent 6e9f601 commit 263c831

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/libAtomVM/otp_socket.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,9 +1820,7 @@ static ssize_t do_socket_recv(struct SocketResource *rsrc_obj, uint8_t *buf, siz
18201820

18211821
ssize_t socket_recv(struct SocketResource *rsrc_obj, uint8_t *buf, size_t len, int flags, term *from, Heap *heap)
18221822
{
1823-
SMP_RWLOCK_RDLOCK(rsrc_obj->socket_lock);
18241823
ssize_t result = do_socket_recv(rsrc_obj, buf, len, flags, from, heap);
1825-
SMP_RWLOCK_UNLOCK(rsrc_obj->socket_lock);
18261824
return result;
18271825
}
18281826

0 commit comments

Comments
 (0)