aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/Manager/OpenGridServices.Manager/BlockingQueue.cs
diff options
context:
space:
mode:
authorSean Dague2007-07-16 15:40:11 +0000
committerSean Dague2007-07-16 15:40:11 +0000
commit2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch)
treee3f80ad51736cf17e856547b1bcf956010927434 /OpenSim/Grid/Manager/OpenGridServices.Manager/BlockingQueue.cs
parent*Trunk compiles now (diff)
downloadopensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip
opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz
opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2
opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz
changed to native line ending encoding
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/Manager/OpenGridServices.Manager/BlockingQueue.cs66
1 files changed, 33 insertions, 33 deletions
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/BlockingQueue.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/BlockingQueue.cs
index 83685fc..be47385 100644
--- a/OpenSim/Grid/Manager/OpenGridServices.Manager/BlockingQueue.cs
+++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/BlockingQueue.cs
@@ -1,33 +1,33 @@
1using System; 1using System;
2using System.Threading; 2using System.Threading;
3using System.Collections.Generic; 3using System.Collections.Generic;
4using System.Text; 4using System.Text;
5 5
6namespace OpenGridServices.Manager 6namespace OpenGridServices.Manager
7{ 7{
8 public class BlockingQueue<T> 8 public class BlockingQueue<T>
9 { 9 {
10 private Queue<T> _queue = new Queue<T>(); 10 private Queue<T> _queue = new Queue<T>();
11 private object _queueSync = new object(); 11 private object _queueSync = new object();
12 12
13 public void Enqueue(T value) 13 public void Enqueue(T value)
14 { 14 {
15 lock (_queueSync) 15 lock (_queueSync)
16 { 16 {
17 _queue.Enqueue(value); 17 _queue.Enqueue(value);
18 Monitor.Pulse(_queueSync); 18 Monitor.Pulse(_queueSync);
19 } 19 }
20 } 20 }
21 21
22 public T Dequeue() 22 public T Dequeue()
23 { 23 {
24 lock (_queueSync) 24 lock (_queueSync)
25 { 25 {
26 if (_queue.Count < 1) 26 if (_queue.Count < 1)
27 Monitor.Wait(_queueSync); 27 Monitor.Wait(_queueSync);
28 28
29 return _queue.Dequeue(); 29 return _queue.Dequeue();
30 } 30 }
31 } 31 }
32 } 32 }
33} 33}