reorganize pthread data structures and move the definitions to alltypes.h