changed yarp threadptr to scopedpointer