question #1: Just look at 'generation' as the group you (the thread) belongs to, whole groups are allowed in, so if the door opens the group # is increased, and everyone belonging to the group that was already waiting is allowed in, even if the door is seen as 'locked' again.
question #2: I guess that is an error - it probably should read 'every time the gate is opened ...'
Simon Groenewolt
2010-07-14 06:36:47