TsgcWebSocketServer_HTTPAPI › Methods › UnShareList
Releases the shared (read-only) lock previously acquired by ShareList.
public void UnShareList();
UnShareList releases the shared SRW lock taken by ShareList so that other readers can finish and writers (new connections, disconnects, LockList) can acquire the exclusive lock again. Every call to ShareList must be paired with exactly one call to UnShareList; place the call in the finally branch of a try..finally block so the lock is released even when the reader code raises an exception. Calling UnShareList without an outstanding ShareList produces undefined behavior.
TList oList = oServer.ShareList();
try {
// read-only iteration
} finally {
oServer.UnShareList();
}