A device for adjusting the angle of rotation between two rotating shafts, in particular a drive shaft of a reciprocating-piston internal combustion engine and a camshaft for actuating gas-exchange valves is provided, having a rotation element that is connected in a rotationally fixed manner to the drive shaft, a rotor that is connected in a rotationally fixed manner to the camshaft, and an angle of rotation adjustment system with a locking device which has at least one locking bolt, which is mounted movably in one of the components, and at least one corresponding opening in the other component. The locking bolt can be displaced into and out of the opening by a spring and/or hydraulic force.