Added some interface to threadDemo