elihaber / sascha

Simple chess engine
0 stars 0 forks source link

Find better way to end input thread #7

Open elihaber opened 3 years ago

elihaber commented 3 years ago

Currently, the input thread cannot be ended nicely because it has its own internal wait for input, and never sees the end request from main if it is still waiting for input, which it usually is. To get around this, I added logic in the input thread to wait for a second after getting a quit command from the UI. Now it has a chance to receive the end command from main before it starts to wait for more input. But this is a hack -- there must be a cleaner way to do this.