make results thread wait for tasks thread