Added base code for pthread