MCPcopy Create free account
hub / github.com/cogentcore/core / AsyncLock

Method AsyncLock

core/render.go:27–40  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

25// outside of the main configuration, rendering, and event handling structure.
26// It must have a matching [WidgetBase.AsyncUnlock] after it.
27func (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.

Callers 9

watchUpdateMethod · 0.80
GoUpdatePlotMethod · 0.80
makeColumnsMethod · 0.80
handleElementFunction · 0.80
AsyncUpdateTableMethod · 0.80
waitNoEventsMethod · 0.80
selectionMonitorMethod · 0.80
mainFunction · 0.80
PlayMethod · 0.80

Calls 3

lockMethod · 0.80
unlockMethod · 0.80
renderContextMethod · 0.45

Tested by

no test coverage detected