void AddSpecial (ArrayList coll, ListenerPrefix prefix)
{
if (coll == null)
return;
try {
plock.AcquireReaderLock (-1);
foreach (ListenerPrefix p in coll) {
if (p.Path == prefix.Path) //TODO: code
throw new HttpListenerException (400, "Prefix already in use.");
}
plock.UpgradeToWriterLock (-1);
coll.Add (prefix);
} finally {
try {
plock.ReleaseReaderLock (); // This releases the writer lock if held.
} catch { }
}
}