deadlock by fork in thread