I am using Algorithm2E and I find myself in a situation where I want to express while(!condition);, but I cannot do that on a single line, it seems. This is the closest I got:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[linesnumbered, ruled]{algorithm2e}
\begin{document}
\begin{algorithm}[H]
\SetKwFunction{KwCrit}{critcalSection}
\SetKwFunction{Kwtas}{test-and-set}
\While{$\Kwtas(r) = 1$}{ }
\KwCrit()\\
$r \gets 0$\\
\caption{Pseudocode of test-and-set usage}
\end{algorithm}
\end{document}
But this puts a single line containing only end. It expresses what I want, but looks quite dirty. How would I be able to express this on a single line?

\documentclass, includes all relevant\usepackagecommands, ends with\end{document}and compiles without errors, even if it does not produce your desired output.