int setScan(char *buf, int len) { int retVal = writeFile(SCAN_FILE, buf, len); //delete the old scan positions if(retVal == SUCCESS){ struct safetyPos * tmp; while(sphead != NULL && sphead != sptail) { tmp = sphead->next; delete sphead; sphead = tmp; } if(sphead) delete sphead; sphead = NULL; sptail = NULL; } loadScans(); return retVal; }
//-------------------------------------------------------------- void threadedScanLoader::threadedFunction() { while (isThreadRunning() != 0){ loadScans(folderName); } }