AsyncLock must be called before making any updates in a separate goroutine outside of the main configuration, rendering, and event handling structure. It must have a matching [WidgetBase.AsyncUnlock] after it.
()
| 25 | // outside of the main configuration, rendering, and event handling structure. |
| 26 | // It must have a matching [WidgetBase.AsyncUnlock] after it. |
| 27 | func (wb *WidgetBase) AsyncLock() { |
| 28 | rc := wb.Scene.renderContext() |
| 29 | if rc == nil { |
| 30 | // if there is no render context, we are probably |
| 31 | // being deleted, so we just block forever |
| 32 | select {} |
| 33 | } |
| 34 | rc.lock() |
| 35 | if wb.This == nil { |
| 36 | rc.unlock() |
| 37 | select {} |
| 38 | } |
| 39 | wb.Scene.updating = true |
| 40 | } |
| 41 | |
| 42 | // AsyncUnlock must be called after making any updates in a separate goroutine |
| 43 | // outside of the main configuration, rendering, and event handling structure. |
no test coverage detected