lock thread for user input