termbox-go icon indicating copy to clipboard operation
termbox-go copied to clipboard

flush is not goroutine friendly

Open vessenes opened this issue 8 years ago • 3 comments

I'm not sure how or if you'd like to address this, but flush gets unhappy if it is being called by multiple goroutines at the same time, and panics. (usually at termbox.go:234).

In my own code, I've wrapped calls to flush with a Mutex, which seems to fix my problems, but note that I haven't run this through the race detector at length to see if things are truly okay with that simple fix.

As a general matter, I think it's nice to maintain concurrency support if possible in a go library, and so I would recommend incorporating something like this, but your call obviously.

vessenes avatar Dec 28 '15 19:12 vessenes