function session = hGetSession(aPool)
%

%   Copyright 2019-2021 The MathWorks, Inc.

if isa(aPool, "parallel.ThreadPool")
    session = parallel.internal.pool.ThreadsBackedSession(aPool, @() aPool.unsupportedFeatureError());
else
    aPool.unsupportedFeatureError();
end
