aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-07-12 21:03:12 +0000
committerJustin Clarke Casey2008-07-12 21:03:12 +0000
commit000d5e8b93c865f7be21717a52a5a897b0ce3344 (patch)
tree742cb284ff2fb3f20fa158fc0258fdd4e9b9e41f /OpenSim/Region/Environment/Scenes/Scene.cs
parent* refactor: Move xml/archive loading and saving code into separate methods re... (diff)
downloadopensim-SC-000d5e8b93c865f7be21717a52a5a897b0ce3344.zip
opensim-SC-000d5e8b93c865f7be21717a52a5a897b0ce3344.tar.gz
opensim-SC-000d5e8b93c865f7be21717a52a5a897b0ce3344.tar.bz2
opensim-SC-000d5e8b93c865f7be21717a52a5a897b0ce3344.tar.xz
* minor: just some null guards and name changes to make it clearer that prim count is actually a prim local id dispenser
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index d6bbb1f..a0df9a1 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -72,8 +72,12 @@ namespace OpenSim.Region.Environment.Scenes
72 72
73 public InnerScene m_innerScene; 73 public InnerScene m_innerScene;
74 74
75 // private Random Rand = new Random(); 75 /// <summary>
76 private uint _primCount = 720000; 76 /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is
77 /// dispenced.
78 /// </summary>
79 private uint m_localId = 720000;
80
77 private readonly Mutex _primAllocateMutex = new Mutex(false); 81 private readonly Mutex _primAllocateMutex = new Mutex(false);
78 82
79 private int m_timePhase = 24; 83 private int m_timePhase = 24;
@@ -1493,16 +1497,15 @@ namespace OpenSim.Region.Environment.Scenes
1493 } 1497 }
1494 1498
1495 /// <summary> 1499 /// <summary>
1496 /// Returns a new unallocated primitive ID 1500 /// Returns a new unallocated local primitive ID
1497 /// </summary> 1501 /// </summary>
1498 /// <returns>A brand new primitive ID</returns> 1502 /// <returns>A brand new local primitive ID</returns>
1499 public uint PrimIDAllocate() 1503 public uint PrimIDAllocate()
1500 { 1504 {
1501 uint myID; 1505 uint myID;
1502 1506
1503 _primAllocateMutex.WaitOne(); 1507 _primAllocateMutex.WaitOne();
1504 ++_primCount; 1508 myID = ++m_localId;
1505 myID = _primCount;
1506 _primAllocateMutex.ReleaseMutex(); 1509 _primAllocateMutex.ReleaseMutex();
1507 1510
1508 return myID; 1511 return myID;