You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2020/02/09 06:15:56 UTC

[lucenenet] 04/35: BREAKING: Lucene.Net.Support.Threading: Deleted unused ThreadLock class

This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 933e3459425382c31edd968f785eae77d0e18e1d
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Thu Feb 6 20:18:10 2020 +0700

    BREAKING: Lucene.Net.Support.Threading: Deleted unused ThreadLock class
---
 src/Lucene.Net/Support/Threading/ThreadLock.cs | 83 --------------------------
 1 file changed, 83 deletions(-)

diff --git a/src/Lucene.Net/Support/Threading/ThreadLock.cs b/src/Lucene.Net/Support/Threading/ThreadLock.cs
deleted file mode 100644
index d3b725c..0000000
--- a/src/Lucene.Net/Support/Threading/ThreadLock.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-using System.Threading;
-
-namespace Lucene.Net.Support.Threading
-{
-    /// <summary>
-    /// Abstract base class that provides a synchronization interface
-    /// for derived lock types
-    /// </summary>
-    public abstract class ThreadLock
-    {
-        public abstract void Enter(object obj);
-
-        public abstract void Exit(object obj);
-
-        private static readonly ThreadLock _nullLock = new NullThreadLock();
-        private static readonly ThreadLock _monitorLock = new MonitorThreadLock();
-
-        /// <summary>
-        /// A ThreadLock class that actually does no locking
-        /// Used in ParallelMultiSearcher/MultiSearcher
-        /// </summary>
-        public static ThreadLock NullLock
-        {
-            get { return _nullLock; }
-        }
-
-        /// <summary>
-        /// Wrapper class for the Monitor Enter/Exit methods
-        /// using the <see cref="ThreadLock"/> interface
-        /// </summary>
-        public static ThreadLock MonitorLock
-        {
-            get { return _monitorLock; }
-        }
-
-        private sealed class NullThreadLock : ThreadLock
-        {
-            public override void Enter(object obj)
-            {
-                // Do nothing
-            }
-
-            public override void Exit(object obj)
-            {
-                // Do nothing
-            }
-        }
-
-        private sealed class MonitorThreadLock : ThreadLock
-        {
-            public override void Enter(object obj)
-            {
-                Monitor.Enter(obj);
-            }
-
-            public override void Exit(object obj)
-            {
-                Monitor.Exit(obj);
-            }
-        }
-    }
-}
\ No newline at end of file