lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conniey <...@git.apache.org>
Subject [GitHub] lucenenet pull request: Removing Apache.NMS dependency.
Date Sat, 23 Apr 2016 17:28:06 GMT
Github user conniey commented on a diff in the pull request:

    https://github.com/apache/lucenenet/pull/168#discussion_r60831857
  
    --- Diff: src/Lucene.Net.Tests/core/Index/TestIndexWriterWithThreads.cs ---
    @@ -657,7 +655,7 @@ public virtual void TestRollbackAndCommitWithThreads()
                 }
     
                 Assert.IsTrue(!failed.Get());
    -            writerRef.Value.Dispose();
    +            writerRef.Dispose();
    --- End diff --
    
    @synhershko is correct. You can box this value with a helper class like:
    
    ```csharp
    class Helper<T> where T : class
        {
            private T _value;
    
            public Helper() : this(default(T))
            { }
    
            public Helper(T initial)
            {
                _value = initial;
            }
    
            public T Value
            {
                get
                {
                    lock (_value)
                    {
                        return _value;
                    }
                }
                set
                {
                    Interlocked.Exchange(ref _value, value);
                }
            }
        }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message