porting thread classes