pthread: initial add
added pthread test case
address comments in PR
more comments