fork of extension pthread which add more support to globals