teBSFrsltCodes CPacBioUtility::StartAsyncLoadSeqs(int NumInputFiles, // number of input files char **ppszInputFiles, // names (wildcards allowed) of input files containing reads to be filtered int MaxReadahead) // read ahead for at most this number of sequences { if(NumInputFiles < 1 || ppszInputFiles == NULL || ppszInputFiles[0] == NULL) return(eBSFerrParams); if(MaxReadahead < 100) MaxReadahead = 100; else if(MaxReadahead > 100000) MaxReadahead = 100000; // can't start a new async load if already loading if(m_bAsyncLoading) return(eBSFerrInternal); Reset(); m_bAsyncLoading = true; if((m_pQuerySeqs = new tsQuerySeq [MaxReadahead]) == NULL) { gDiagnostics.DiagOut(eDLFatal,gszProcName,"Failed to allocate memory for query sequences"); Reset(); return(eBSFerrMem); } m_AllocdQuerySeqs = MaxReadahead; m_NumQuerySeqs = 0; m_NxtQuerySeqIdx = 0; m_TotSeqIDs = 0; if(CreateMutexes()!=eBSFSuccess) { gDiagnostics.DiagOut(eDLFatal,gszProcName,"Failed to create thread synchronisation mutexes"); Reset(); return(cBSFSyncObjErr); } m_NumInputFiles = NumInputFiles; m_ppszInputFiles = ppszInputFiles; return((teBSFrsltCodes)InitLoadQuerySeqs()); }
int InitClient() { int res = (CreateSystemEvents() || CreateMutexes() || CreateSharedMem()); return res; }