0

.Net 中的 SqlGeometry.STUnion 方法线程安全吗? MSDN

4

2 回答 2

1

使用 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);
    }

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

于 2014-04-23T11:17:28.660 回答
0

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

于 2014-04-23T10:47:41.733 回答