Male gymnast MUST ALWAYS have their thumbs around the Bar.
Female gymnast normally have thumbs around while in support (e.g. cast handstand) then flip the thumb back with the rest of the fingers during swings (e.g. giant, free hip, etc.)
Here’s an example — posted by Gymnastics Crossing — of a female gymnast who DOES sometimes keep her thumbs around on the swing. An exception to the norm.
Click PLAY or watch it on YouTube.
Note the thumb tape.