Remove pthread dependency