I turn once, so what is out will not get in. I turn again, so what is in will not get out. What am I? 

Answer in comments