A public bathhouse – such as a Mikveh – is treated by Halacha like a restroom in that one may not think about Torah matters there. Just as it is forbidden to think of Torah matters in a restroom, so must one refrain from such thoughts in the inner room of a bathhouse (as opposed to the changing room outside). Even when nobody is present, one must not think of Torah matters in a Mikveh, as it is considered a place of filth ("Zuhama").
Unlike in a restroom, however, in a Mikveh one is allowed to speak about non-Torah matters. Although speaking is considered inappropriate and immodest in a restroom, it is permissible in a Mikveh.

