8000 extmod/modlwip: socket->incoming changed by async callbacks, must be … · micropython/micropython@4deb493 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4deb493

Browse files
author
Paul Sokolovsky
committed
extmod/modlwip: socket->incoming changed by async callbacks, must be volatile.
Otherwise for code like: while (socket->incoming == NULL) { LWIP_DELAY(100); } a compiler may cache it in a register and it will be an infinite loop.
1 parent 0ec5144 commit 4deb493

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extmod/modlwip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ typedef struct _lwip_socket_obj_t {
184184
mp_obj_base_t base;
185185

186186
void *pcb;
187-
void *incoming;
187+
void *volatile incoming;
188188
byte peer[4];
189189
mp_uint_t peer_port;
190190
mp_uint_t timeout;

0 commit comments

Comments
 (0)
0