Let us use the equation dMz/dt =Nz relative to the axis through O .....(1)
For this purpose, let us find the angular momentum of the system Mz about the given rotation axis and the corresponding torque Nz. The angular momentum is

The downward pull of gravity on the overhanging part is the only external force, which exerts a torque about the z-axis, passing through O and is given by,
Note: We may solve this problem using conservation of mechanical energy of the system (cylinder + thread) in the uniform field of gravity.