If you shut yourself in a room, you stay in there and make sure nobody else can get in. After one particular bad result, he shut himself in the shower room for an hour see also shut-in
If you shut someone or something in a room, you close the door so that they cannot leave it. The door enables us to shut the birds in the shelter in bad weather