added check for parent thread == alive to _mksocket