generic atomic function
Merge remote-tracking branch 'origin'