2. Given $x \in(0,2 \pi)$, then the sum of all roots of the equation $3 \operatorname{ctg}^{2} x+$ $8 \operatorname{ctg} x+3=0$ is ( ).
(A) $3 \pi$
(B) $4 \pi$
(C) $5 \pi$
(D) $6 \pi$
2. (C).

Let $\operatorname{ctg} x_{1}, \operatorname{ctg} x_{2}$ be the two roots of the equation in terms of $\operatorname{ctg} x$.
Then $\operatorname{ctg} x_{1}+\operatorname{ctg} x_{2}=-\frac{8}{3}$,
$$
\begin{array}{l}
\operatorname{ctg} x_{1} \cdot \operatorname{ctg} x_{2}=1 . \\
\therefore \operatorname{ctg} x_{1}<0, \operatorname{ctg} x_{2}<0 .
\end{array}
$$

When $x_{1}, x_{2}$ are in the second quadrant,
$x_{1}-\frac{\pi}{2}$ and $\pi-x_{2}$ are both acute angles.
From (1) we get $\operatorname{tg}\left(x_{1}-\frac{\pi}{2}\right)=\operatorname{tg}\left(\pi-x_{2}\right)$,
$\therefore x_{1}-\frac{\pi}{2}=\pi-x_{2}$, i.e., $x_{1}+x_{2}=\frac{3 \pi}{2}$.
Also, $x_{1}+\pi$ and $x_{2}+\pi$ are in the fourth quadrant and are roots of the original equation (the equation in terms of $x$), so the sum of all roots is
$$
\begin{array}{l}
x_{1}+x_{2}+\left(x_{1}+\pi\right)+\left(x_{2}+\pi\right) \\
=2 \pi+2\left(x_{1}+x_{2}\right)=5 \pi
\end{array}
$$