aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Manager/CollisionLocker.cs
blob: 7a1172055b127ec7d76e15949335c5e879de8f73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Text;

namespace OpenSim.Region.Physics.Manager
{
    public class CollisionLocker
    {
        
        private bool locked = false;
        private List<IntPtr> worldlock = new List<IntPtr>();
        public CollisionLocker()
        {

        }
        public void dlock(IntPtr world)
        {
            lock (worldlock)
            {
                worldlock.Add(world);
            }

        }
        public void dunlock(IntPtr world)
        {
            lock (worldlock)
            {
                worldlock.Remove(world);
            }
        }
        public bool lockquery()
        {
            return (worldlock.Count > 0);
        }
        public void drelease(IntPtr world)
        {
            lock (worldlock)
            {
                if (worldlock.Contains(world))
                    worldlock.Remove(world);
            }
        }

    }

}