Question about locks and callbacks #6648
Replies: 1 comment
-
Posted at 2015-11-26 by @gfwilliams Yes, that looks fine to me. It's safe because jsiQueueEvents will add references to all the stuff it cares about, so even when unlocked it won't get freed. In that case I'd consider using Also there's Posted at 2015-11-26 by @gfwilliams Just to add, whether it is safe depends on |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-11-26 by tve
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
Beta Was this translation helpful? Give feedback.
All reactions