create thread function outline, need mutex logic