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.
This commit is contained in:
Paul Sokolovsky 2015-10-31 19:48:54 +03:00
parent 0ec51441de
commit 4deb4936d5
1 changed files with 1 additions and 1 deletions

View File

@ -184,7 +184,7 @@ typedef struct _lwip_socket_obj_t {
mp_obj_base_t base;
void *pcb;
void *incoming;
void *volatile incoming;
byte peer[4];
mp_uint_t peer_port;
mp_uint_t timeout;