11 }
12 }
13 Keyfile.close();
14
15 while(TextFiles.empty())
16 { }
17
18 while(!TextFiles.empty())
19 {
20 pthread_mutex_lock(&QueueMutex);
21 Filename = TextFiles.front();
22 TextFiles.pop();
23 pthread_mutex_unlock(&QueueMutex);
24 Infile.open(Filename.c_str());
25 SearchWords.erase(SearchWords.begin(),SearchWords.end());
26
27 while(!Infile.eof() && Infile.good())
28 {
29 Infile >> Temp;
30 SearchWords.insert(Temp);
31 }
32
33 Infile.close();
34 if(includes(SearchWords.begin(),SearchWords.end(),
KeyWords.begin(),KeyWords.end(),Comp)){
35 Outfile << Filename << endl;
36 pthread_mutex_lock(&CountMutex);
37 FileCount--;
38 pthread_mutex_unlock(&CountMutex);
39 FoundCount++;