internal virtual void addLink(Erlang.Pid local, Erlang.Pid remote) { lock(this) { int i; if ((i = 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); } } }
/*clears the link table, returns a copy */ internal virtual 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; } }
/*returns a copy of the link table */ internal virtual Link[] links() { lock(this) { Link[] ret = null; if (_count != 0) { ret = new Link[_count]; Array.Copy(_links, 0, ret, 0, _count); } return ret; } }