是SqlGeometry.STUnion方法螺纹安全

本文关键字:安全 方法 SqlGeometry STUnion | 更新日期: 2023-09-27 17:59:26

是SqlGeometry。STUnion方法螺纹安全入内。网MSDN

是SqlGeometry.STUnion方法螺纹安全

使用JustDecompile:从sql 11.0程序集中解压缩的主体

    [SqlMethod(IsDeterministic=true, IsPrecise=false)]
    public SqlGeometry STUnion(SqlGeometry other)
    {
        if (this.IsNull || other == null || other.IsNull || this.Srid != other.Srid)
        {
            return SqlGeometry.Null;
        }
        this.ThrowIfInvalid();
        other.ThrowIfInvalid();
        return SqlGeometry.Construct(GLNativeMethods.Union(this.GeoData, other.GeoData), this.Srid);
    }

其中SqlGeography.ConstructGLNativeMethods.GeodeticUnion是静态方法,而其他方法不能在任何地方死锁。所使用的方法都没有修改调用对象,所以是的,它是线程安全的。

怎么可能不是呢?SqlGeometry似乎是不可变的,因此2个不可变类的输入应该是确定的输出。