possible fix for thread soft-restart hanging (original fix by ysternaud)