added custom pthread based thread class