12. Let $\frac{1-|\cos x|}{1+|\cos x|}=\sin x$. Then $x=$
$\begin{array}{l}\text { 12. } k \pi, 2 k \pi+\frac{\pi}{2}(k \in \mathbf{Z}) . \\ \text { From } \frac{1-|\cos x|}{1+|\cos x|}=\sin x \\ \Rightarrow \sin ^{2} x=\sin x(1+|\cos x|)^{2} \\ \Rightarrow \sin x=0 \text { or } \cos x=0, \text { and } \sin x=1 \\ \Rightarrow x=k \pi, 2 k \pi+\frac{\pi}{2}(k \in \mathbf{Z}) .\end{array}$