jifunks / botany

command line virtual plant buddy
ISC License
438 stars 32 forks source link

Fix race conditions messing up the display #17

Closed Ensiss closed 6 years ago

Ensiss commented 6 years ago

The display sometimes crashed (characters drawn at random places, text not cleared, etc.) at startup or during a session, sometimes even stopping the entire program. This PR should solve the problem. It adds a lock around code that draws on screen, preventing both threads to draw at the same time.