Changed the print_commands function so that it's impossible for the other thread to 'interrupt' its printing of the commands.
Merge branch 'master' of https://github.com/mirzael/chat_program