diff options
Diffstat (limited to 'src/Util.cs')
-rw-r--r-- | src/Util.cs | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/src/Util.cs b/src/Util.cs deleted file mode 100644 index 477390e..0000000 --- a/src/Util.cs +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | /* | ||
2 | Copyright (c) OpenSim project, http://osgrid.org/ | ||
3 | |||
4 | * Copyright (c) <year>, <copyright holder> | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Redistribution and use in source and binary forms, with or without | ||
8 | * modification, are permitted provided that the following conditions are met: | ||
9 | * * Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * * Redistributions in binary form must reproduce the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer in the | ||
13 | * documentation and/or other materials provided with the distribution. | ||
14 | * * Neither the name of the <organization> nor the | ||
15 | * names of its contributors may be used to endorse or promote products | ||
16 | * derived from this software without specific prior written permission. | ||
17 | * | ||
18 | * THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY | ||
19 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
21 | * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY | ||
22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
28 | */ | ||
29 | |||
30 | using System; | ||
31 | using System.Collections.Generic; | ||
32 | using System.Threading; | ||
33 | using libsecondlife; | ||
34 | using libsecondlife.Packets; | ||
35 | |||
36 | namespace OpenSim | ||
37 | { | ||
38 | /// <summary> | ||
39 | /// </summary> | ||
40 | /// | ||
41 | public class Util | ||
42 | { | ||
43 | public static ulong UIntsToLong(uint X, uint Y) | ||
44 | { | ||
45 | return Helpers.UIntsToLong(X,Y); | ||
46 | } | ||
47 | public Util() | ||
48 | { | ||
49 | |||
50 | } | ||
51 | } | ||
52 | |||
53 | public class QueItem { | ||
54 | public QueItem() | ||
55 | { | ||
56 | } | ||
57 | |||
58 | public Packet Packet; | ||
59 | public bool Incoming; | ||
60 | } | ||
61 | |||
62 | /* this is in IGridServer.cs, so there should be no reason for it to be here as well | ||
63 | public class agentcircuitdata | ||
64 | { | ||
65 | public agentcircuitdata() { } | ||
66 | public LLUUID AgentID; | ||
67 | public LLUUID SessionID; | ||
68 | public LLUUID SecureSessionID; | ||
69 | public string firstname; | ||
70 | public string lastname; | ||
71 | public uint circuitcode; | ||
72 | } | ||
73 | */ | ||
74 | |||
75 | public class BlockingQueue< T > { | ||
76 | private Queue< T > _queue = new Queue< T >(); | ||
77 | private object _queueSync = new object(); | ||
78 | |||
79 | public void Enqueue(T value) | ||
80 | { | ||
81 | lock(_queueSync) | ||
82 | { | ||
83 | _queue.Enqueue(value); | ||
84 | Monitor.Pulse(_queueSync); | ||
85 | } | ||
86 | } | ||
87 | |||
88 | public T Dequeue() | ||
89 | { | ||
90 | lock(_queueSync) | ||
91 | { | ||
92 | if( _queue.Count < 1) | ||
93 | Monitor.Wait(_queueSync); | ||
94 | |||
95 | return _queue.Dequeue(); | ||
96 | } | ||
97 | } | ||
98 | } | ||
99 | } | ||