MCPcopy Create free account
hub / github.com/lxn/walk / RunSynchronized

Method RunSynchronized

windowgroup.go:218–237  ·  view source on GitHub ↗

RunSynchronized runs all of the function calls queued by Synchronize and applies any layout changes queued by synchronizeLayout. RunSynchronized must be called by the group's thread.

()

Source from the content-addressed store, hash-verified

216//
217// RunSynchronized must be called by the group's thread.
218func (g *WindowGroup) RunSynchronized() {
219 // Clear the list of callbacks first to avoid deadlock
220 // if a callback itself calls Synchronize()...
221 g.syncMutex.Lock()
222 funcs := g.syncFuncs
223 var results []*formLayoutResult
224 for _, result := range g.layoutResultsByForm {
225 results = append(results, result)
226 delete(g.layoutResultsByForm, result.form)
227 }
228 g.syncFuncs = nil
229 g.syncMutex.Unlock()
230
231 for _, result := range results {
232 applyLayoutResults(result.results, result.stopwatch)
233 }
234 for _, f := range funcs {
235 f()
236 }
237}
238
239// ToolTip returns the tool tip control for the group, if one exists.
240func (g *WindowGroup) ToolTip() *ToolTip {

Callers 2

shimRunSynchronizedFunction · 0.80
mainLoopMethod · 0.80

Calls 1

applyLayoutResultsFunction · 0.85

Tested by

no test coverage detected