Simplified thread marshaling with a custom Swift operator function