private void RemoveFile(CCBP2PFileList filelist, string file) { lock (filelist) { filelist.Remove(file); } }
public CCBP2PFileWorker(ManualResetEvent closeEvent) : base() { m_closeSignal = closeEvent; m_inbox = new CCBP2PFileList(); m_outbox = new CCBP2PFileList(); m_signal = new ManualResetEvent(false); m_dataPumpThread = null; m_fileTransferDoneCallback = null; }
private List <CCBP2PFile> ScanForWork(CCBP2PFileList filelist) { List <CCBP2PFile> files = new List <CCBP2PFile>(); lock (filelist) { foreach (CCBP2PFile file in filelist.Values) { files.Add(file); } } return(files); }
private void CloseAll(CCBP2PFileList files) { lock (files) { foreach (CCBP2PFile file in files.Values) { try { file.Close(); } catch (IOException ioex) { CCBLogConfig.GetLogger().Error("IO Exception closing file {0}: {1}", file.LocalName, ioex.Message); } catch (Exception ex) { CCBLogConfig.GetLogger().Error("Exception closing file {0}: {1}", file.LocalName, ex.Message); } } } }