Added interruption points in doflashWithProgrammer function.
Set thr value equal to new created thread value in flashWithProgrammer function.
Set thr value equal to new created thread value in serialRead function.