for some code, check with helgrind to test multithread errors.