copied hpx device from pthread device