diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneBase.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneBase.cs | 24 |
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 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Threading; | ||
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
32 | using log4net; | 33 | using log4net; |
33 | using OpenSim.Framework; | 34 | using 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 | { |