Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed obsolete classes

  • Loading branch information...
commit 9a88485776d17e95bfe5bd27a896f8d1ce004492 1 parent eabcfc2
@kmees kmees authored
View
2  src/IronSharePoint.Framework/IronSharePoint.Framework.csproj
@@ -129,10 +129,8 @@
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RackHttpHandler.cs" />
- <Compile Include="Util\BlockingQueue.cs" />
<Compile Include="Util\WrapperControlExtensions.cs" />
<Compile Include="Util\EnumerableExtensions.cs" />
- <Compile Include="Util\IBlockingQueue.cs" />
<Compile Include="Util\ScriptEngineExtensions.cs" />
<Compile Include="Util\ScriptRuntimeExtensions.cs" />
<Compile Include="Util\StringExtensions.cs" />
View
86 src/IronSharePoint.Framework/Util/BlockingQueue.cs
@@ -1,86 +0,0 @@
-using System.Collections.Generic;
-using System.Threading;
-
-namespace IronSharePoint.Util
-{
- /// <summary>
- /// When a consumer thread is dequeuing an item, one is returned if available.
- /// Otherwise, the thread waits on the monitor. When an item is enqueued, the monitor is pulsed,
- /// which wakes up one of the consumer threads, which dequeues the item and returns it.
- /// Taken from http://element533.blogspot.com/2010/01/stoppable-blocking-queue-for-net.html
- /// </summary>
- /// <typeparam name="T"></typeparam>
- public class BlockingQueue<T> : IBlockingQueue<T>
- {
- readonly Queue<T> _queue = new Queue<T>();
- bool _stopped;
-
- #region IBlockingQueue<T> Members
-
- /// <summary>
- /// Number of items in the queue
- /// </summary>
- public int Count
- {
- get
- {
- lock (_queue)
- {
- return _queue.Count;
- }
- }
- }
-
- /// <summary>
- /// Adds an item to the queue and pulses all waiting threads
- /// </summary>
- /// <param name="item"></param>
- /// <returns></returns>
- public bool Enqueue(T item)
- {
- if (_stopped) return false;
- lock (_queue)
- {
- if (_stopped) return false;
- _queue.Enqueue(item);
- Monitor.Pulse(_queue);
- }
- return true;
- }
-
- /// <summary>
- /// Returns the next item from the queue. If the queue is empty,the threads waits for new items.
- /// </summary>
- /// <returns></returns>
- public T Dequeue()
- {
- if (_stopped) return default(T);
- lock (_queue)
- {
- if (_stopped) return default(T);
- while (_queue.Count == 0)
- {
- Monitor.Wait(_queue);
- if (_stopped) return default(T);
- }
- return _queue.Dequeue();
- }
- }
-
- /// <summary>
- /// Stops the queue and pulses all waiting threads.
- /// </summary>
- public void Stop()
- {
- if (_stopped) return;
- lock (_queue)
- {
- if (_stopped) return;
- _stopped = true;
- Monitor.PulseAll(_queue);
- }
- }
-
- #endregion
- }
-}
View
14 src/IronSharePoint.Framework/Util/IBlockingQueue.cs
@@ -1,14 +0,0 @@
-using System;
-using System.Linq;
-using System.Text;
-
-namespace IronSharePoint.Util
-{
- public interface IBlockingQueue<T>
- {
- int Count { get; }
- bool Enqueue(T item);
- T Dequeue();
- void Stop();
- }
-}
Please sign in to comment.
Something went wrong with that request. Please try again.