The reason I'm wondering is that this schedules a callback and then immediately proceeds to release locks (is there really a lock on the null object?). Is this safe because the callback is guaranteed to be completed before the next GC run? (Is GC not run automatically if an allocation fails?)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Is the following code safe?
The reason I'm wondering is that this schedules a callback and then immediately proceeds to release locks (is there really a lock on the null object?). Is this safe because the callback is guaranteed to be completed before the next GC run? (Is GC not run automatically if an allocation fails?)
NB: this snippet came from https://github.com/espruino/Espruino/blob/master/libs/network/esp8266/jswrap_esp8266_network.c#L2008-L2016