cesanta / mongoose-os

Mongoose OS - an IoT Firmware Development Framework. Supported microcontrollers: ESP32, ESP8266, CC3220, CC3200, STM32F4, STM32L4, STM32F7. Amazon AWS IoT, Microsoft Azure, Google IoT Core integrated. Code in C or JavaScript.
https://mongoose-os.com
Other
2.48k stars 430 forks source link

Possible race issues? #585

Closed ryancaicse closed 2 years ago

ryancaicse commented 2 years ago

Hi, the lock us->lock seems to guard the variable us->locked. However, the lock is released before accessing us->locked. Should it be a bug? https://github.com/cesanta/mongoose-os/blob/1ce60619904403e47c81df88d8622e2614c9588e/src/mgos_uart.c#L42-L50

rojer commented 2 years ago

you are right. feel free to send a PR.