Пример #1
0
 public void addLink(OtpErlangPid local, OtpErlangPid remote)
 {
     lock (this)
     {
         if (find(local, remote) == -1)
         {
             if (count >= links.Length)
             {
                 Link[] tmp = new Link[count * 2];
                 Array.Copy(links, 0, tmp, 0, count);
                 links = tmp;
             }
             links[count++] = new Link(local, remote);
         }
     }
 }
Пример #2
0
 /* clears the link table, returns a copy */
 public Link[] clearLinks()
 {
     lock (this)
     {
         Link[] ret = null;
         if (count != 0)
         {
             ret = new Link[count];
             for (int i = 0; i < count; i++)
             {
                 ret[i] = links[i];
                 links[i] = null;
             }
             count = 0;
         }
         return ret;
     }
 }