diff options
Diffstat (limited to 'OpenSim/Region/Physics/Manager/CollisionLocker.cs')
-rw-r--r-- | OpenSim/Region/Physics/Manager/CollisionLocker.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/Manager/CollisionLocker.cs b/OpenSim/Region/Physics/Manager/CollisionLocker.cs new file mode 100644 index 0000000..7a11720 --- /dev/null +++ b/OpenSim/Region/Physics/Manager/CollisionLocker.cs | |||
@@ -0,0 +1,46 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Region.Physics.Manager | ||
6 | { | ||
7 | public class CollisionLocker | ||
8 | { | ||
9 | |||
10 | private bool locked = false; | ||
11 | private List<IntPtr> worldlock = new List<IntPtr>(); | ||
12 | public CollisionLocker() | ||
13 | { | ||
14 | |||
15 | } | ||
16 | public void dlock(IntPtr world) | ||
17 | { | ||
18 | lock (worldlock) | ||
19 | { | ||
20 | worldlock.Add(world); | ||
21 | } | ||
22 | |||
23 | } | ||
24 | public void dunlock(IntPtr world) | ||
25 | { | ||
26 | lock (worldlock) | ||
27 | { | ||
28 | worldlock.Remove(world); | ||
29 | } | ||
30 | } | ||
31 | public bool lockquery() | ||
32 | { | ||
33 | return (worldlock.Count > 0); | ||
34 | } | ||
35 | public void drelease(IntPtr world) | ||
36 | { | ||
37 | lock (worldlock) | ||
38 | { | ||
39 | if (worldlock.Contains(world)) | ||
40 | worldlock.Remove(world); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | } | ||
45 | |||
46 | } | ||