Ejemplo n.º 1
0
 public VBinderThreadState(Thread current)
 {
     Contract.Ensures(Owner == current);
     Capabilities = new CapabilityRef(current, 0, Globals.CapabilityManager.NullCapability);
     MessageQueue = new VBinderMessageBuffer(Capacity, current);
     this.Owner   = current;
 }
Ejemplo n.º 2
0
 public void InsertAfter(CapabilityRef head)
 {
     this.Prev = head;
     this.Next = head.Next;
     if (head.Next != null)
     {
         head.Next.Prev = this;
     }
     head.Next = this;
 }
Ejemplo n.º 3
0
        internal Capability(Thread parent, int label, int permission, bool isNullCapability)
        {
            Contract.Requires(parent == null || parent.VBinderState.Owner == parent);

            this.parent     = parent;
            this.label      = label;
            this.permission = permission;

            if (!isNullCapability)
            {
                var id = parent.VBinderState.NewCapAllocId();
                this.Uses = new CapabilityRef(parent, id, this);
            }
        }
Ejemplo n.º 4
0
        public int MapInCapability(Thread current, Capability cap)
        {
            int id;

            if (cap.parent == current)
            {
                id = cap.Uses.id;
                cap.Uses.InsertAfter(Capabilities);
            }
            else
            {
                id = NewCapAllocId();
                var cap_ref = new CapabilityRef(current, id, cap);
                cap_ref.InsertAfter(Capabilities);
            }

            return(id);
        }
Ejemplo n.º 5
0
 internal void AddUses(CapabilityRef uses)
 {
     // throw new NotImplementedException();
 }