Duplicate of Help With Error In C Program. Thread closed. Avoid creating the same thread over and over again