It should be noted that because the torques caused by the bar and cylinder weights are equal, the bar-cylinder system remains static and does not rotate around the peg in hole C.
Because it is in equilibrium, the bar-cylinder system does not spin around the peg in hole C. The torque on the system caused by the cylinder hanging from hole B is balanced by the torque caused by the bar and its distribution around the center of mass at hole D.
The center of mass is positioned so that the torques generated by the weights of the bar and the cylinder are equal and opposite, resulting in a net torque on the system.