Fixed thread managing.
It worked for the case test.
updating main.c
Merge origin/Part_4 into Part_4