locking: added gcc function attributes.