Replaces calls to the deprecated function task::spawn by Thread::spawn.