/** * Remove the socket from all lists and queues. This will make it safe to * erase/delete the socket. It will also cause the main thread to stop calling * send() for the socket. * * @param socket address to the socket that should be removed */ void UploadBandwidthThrottler::DoRemoveFromAllQueues(ThrottledControlSocket* socket) { if ( m_doRun ) { // Remove this socket from control packet queue EraseValue( m_ControlQueue_list, socket ); EraseValue( m_ControlQueueFirst_list, socket ); wxMutexLocker lock( m_tempQueueLocker ); EraseValue( m_TempControlQueue_list, socket ); EraseValue( m_TempControlQueueFirst_list, socket ); } }
void CDownloadQueue::RemoveLocalServerRequest( CPartFile* file ) { wxMutexLocker lock( m_mutex ); EraseValue( m_localServerReqQueue, file ); file->SetLocalSrcRequestQueued(false); }
void CDownloadQueue::RemoveFile(CPartFile* file) { RemoveLocalServerRequest( file ); NotifyObservers( EventType( EventType::REMOVED, file ) ); wxMutexLocker lock( m_mutex ); EraseValue( m_filelist, file ); }
void CDownloadQueue::RemoveFile(CPartFile* file, bool keepAsCompleted) { RemoveLocalServerRequest( file ); NotifyObservers( EventType( EventType::REMOVED, file ) ); wxMutexLocker lock( m_mutex ); EraseValue( m_filelist, file ); if (keepAsCompleted) { m_completedDownloads.push_back(file); } }