Optimized ARM RWSEM algorithm