use
thread.join.
if you use this then 2nd thread will start only after the first one gets completed.