Locking mechanism to be attached to a device or a device part comprising a first and a second part, - the first part is fixed unreleasably to a stationary part via a hinge connection (5, 6) defining a swing axis a1, the first part can pivot relative to the stationary part along the swing axis a1 and has at least two positions: a locking position and a not locking position, the first part comprises: --- a protruding part extending in direction of the second part and having a first contact surface, --- an attachment position for a spring or spring system which spring or spring system forces the first part into the locked position, upon biasing the spring the first part is brought to the unlocked position, --- a release mechanism (1c, 1d) which upon user impact biases the spring, - the second part comprises a first protruding part having a second contact surface and a second protruding part having a third contact surface, the second part can be in a locked position and in an unlocked position and when in the locked position the first contact surface touches the second contact surface, the second part is placed in a bearing (3, 3a, 3b) allowing rotation between the locked and unlocked positions of the second part and the bearing (3, 3a, 3b) is fixed relative to the stationary part, the bearing (3, 3a, 3b) or the stationary part or an independent part held in position by the stationary part or by the bearing (3, 3a) has a fourth contact surface and when in the locked position the third contact surface of the second part touches the fourth contact surface, wherein the stationary part is a closed profile. - the first part is fixed unreleasably to a stationary part via a hinge connection (5, 6) defining a swing axis a1, the first part can pivot relative to the stationary part along the swing axis a1 and has at least two positions: a locking position and a not locking position, the first part comprises: --- a protruding part extending in direction of the second part and having a first contact surface, --- an attachment position for a spring or spring system which spring or spring system forces the first part into the locked position, upon biasing the spring the first part is brought to the unlocked position, --- a release mechanism (1c, 1d) which upon user impact biases the spring, --- a protruding part extending in direction of the second part and having a first contact surface, --- an attachment position for a spring or spring system which spring or spring system forces the first part into the locked position, upon biasing the spring the first part is brought to the unlocked position, --- a release mechanism (1c, 1d) which upon user impact biases the spring, - the second part comprises a first protruding part having a second contact surface and a second protruding part having a third contact surface, the second part can be in a locked position and in an unlocked position and when in the locked position the first contact surface touches the second contact surface, the second part is placed in a bearing (3, 3a, 3b) allowing rotation between the locked and unlocked positions of the second part and the bearing (3, 3a, 3b) is fixed relative to the stationary part, the bearing (3, 3a, 3b) or the stationary part or an independent part held in position by the stationary part or by the bearing (3, 3a) has a fourth contact surface and when in the locked position the third contact surface of the second part touches the fourth contact surface,