A double Hopf bifurcation has been found of the flow in a cylinder driven by the rotation of an endwall. A detailed analysis of the multiple solutions in a large region of parameter space, computed with an efficient and accurate three-dimensional Navier-Stokes solver, is presented. At the double Hopf points, an axisymmetric limit cycle and a rotating wave bifurcate simultaneously. The corresponding mode interaction generates an unstable two-torus modulate rotating wave solutions and gives a wedge-shaped region in parameter space where the two periodic solutions are both stable. By exploring in detail the three-dimensional structure of the flow, we have identified the two mechanisms that compete in the neighborhood of the double Hopf. Both are associated with the jet that is formed when the Ekman layer on the rotating endwall is turned by the stationary sidewall.