diff options
| author | Paul Sokolovsky | 2015-10-31 19:48:54 +0300 |
|---|---|---|
| committer | Paul Sokolovsky | 2015-10-31 19:51:23 +0300 |
| commit | 4deb4936d52da88752da93f9cdc49541c10ef413 (patch) | |
| tree | 670df262c5cddfbbd425f2a4ae761cebf85b7972 /extmod | |
| parent | 0ec51441de4db3fc776b1f2013005391caa910d3 (diff) | |
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.
Diffstat (limited to 'extmod')
| -rw-r--r-- | extmod/modlwip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/modlwip.c b/extmod/modlwip.c index ced9c06a1..0f3ab7c15 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -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; |
