refine threadevent pthread impl