int should_stop = 0;
void keyboard_processor() {
while (should_stop != 1) {
char input = get_input();
if (input == 'q' || input == 'Q') {
should_stop = 1;
break;
}
}
}
int main() {
start_thread(keyboard_processor);
while (should_stop != 1) {
do_work();
}
}