Add StdinThread class