  Supermassive stars and quasi-stars (massive stars with a central black hole)
are both considered as potential progenitors for the formation of supermassive
black holes. They are expected to form from rapidly accreting protostars in
massive primordial halos. We explore how long rapidly accreting protostars
remain on the Hayashi track, implying large protostellar radii and weak
accretion luminosity feedback. We assess the potential role of energy
production in the nuclear core, and determine what regulates the evolution of
such protostars into quasi-stars or supermassive stars. We follow the
contraction of characteristic mass scales in rapidly accreting protostars, and
infer the timescales for them to reach nuclear densities. We compare the
characteristic timescales for nuclear burning with those for which the extended
protostellar envelope can be maintained. We find that the extended envelope can
be maintained up to protostellar masses of 3.6x10^8 \dot{m}^3 solar, where
\dot{m} denotes the accretion rate in solar masses per year. We expect the
nuclear core to exhaust its hydrogen content in 7x10^6 yrs. If accretion rates
\dot{m}>>0.14 can still be maintained at this point, a black hole may form
within the accreting envelope, leading to a quasi-star. Alternatively, the
accreting object will gravitationally contract to become a main-sequence
supermassive star. Due to the limited gas reservoir in dark matter halos with
10^7 solar masses, the accretion rate onto the central object may drop at late
times, implying the formation of supermassive stars as the typical outcome of
direct collapse. However, if high accretion rates are maintained, a quasi-star
with an interior black hole may form.
