log after mutex.lock(), not before.