function out = workerSession(in)
%parallel.internal.pool.workerSession Get or set the singleton worker
% session object held by MATLAB Worker processes.
%
% This will be set by workers during initialization. It must remain empty
% for the client, who should use pool.hGetClient() instead.

% Copyright 2019 The MathWorks, Inc.

persistent state
if nargout
    out = state;
end
if nargin
    mlock;
    state = in;
end
end
