Add more details to Gui.Flush()'s documentation

This commit is contained in:
Roi Martin 2015-02-02 01:04:33 +01:00
parent d786a4aec1
commit f819237d78
1 changed files with 6 additions and 2 deletions

8
gui.go
View File

@ -256,8 +256,12 @@ func (g *Gui) handleEvent(ev *termbox.Event) error {
}
}
// Flush updates the gui, re-drawing frames and buffers. It is safe for
// concurrent use by multiple goroutines.
// Flush updates the gui, re-drawing frames and buffers.
//
// Flush is safe for concurrent use by multiple goroutines. However it is
// important to note that it will make the layout function to be called, which
// could lead to a dead lock if the same mutex is used in both the function
// calling Flush and the layout function.
func (g *Gui) Flush() error {
g.mu.Lock()
defer g.mu.Unlock()