aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneBase.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneBase.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index bf0e211..bba31f7 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Threading;
31using OpenMetaverse; 32using OpenMetaverse;
32using log4net; 33using log4net;
33using OpenSim.Framework; 34using OpenSim.Framework;
@@ -48,6 +49,14 @@ namespace OpenSim.Region.Environment.Scenes
48 49
49 #region Fields 50 #region Fields
50 51
52 /// <summary>
53 /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is
54 /// dispensed.
55 /// </summary>
56 private uint m_lastAllocatedLocalId = 720000;
57
58 private readonly Mutex _primAllocateMutex = new Mutex(false);
59
51 private readonly ClientManager m_clientManager = new ClientManager(); 60 private readonly ClientManager m_clientManager = new ClientManager();
52 61
53 public ClientManager ClientManager 62 public ClientManager ClientManager
@@ -212,6 +221,21 @@ namespace OpenSim.Region.Environment.Scenes
212 221
213 return null; 222 return null;
214 } 223 }
224
225 /// <summary>
226 /// Returns a new unallocated local ID
227 /// </summary>
228 /// <returns>A brand new local ID</returns>
229 protected internal uint AllocateLocalId()
230 {
231 uint myID;
232
233 _primAllocateMutex.WaitOne();
234 myID = ++m_lastAllocatedLocalId;
235 _primAllocateMutex.ReleaseMutex();
236
237 return myID;
238 }
215 239
216 public virtual T RequestModuleInterface<T>() 240 public virtual T RequestModuleInterface<T>()
217 { 241 {