public CommunicationObject(Connection connection, bool useExclusiveAccess = false) { header = new Header(connection); md5 = MD5.Create(); if (useExclusiveAccess) { simpleLock.Enter(); } this.useExclusiveAccess = useExclusiveAccess; this.connection = connection; }
public void Add(IEventListener listener) { subscribersLock.Enter(); subscribers.Add(listener); subscribersLock.Exit(); }