Beispiel #1
0
 public void Write(int threadId, string updatedText)
 {
     _sourceReadWriteLock.EnterWriteLock();
     try
     {
         // Extra check so that the file is not picked up by other threads.
         if (CheckIndexBeforeUpdate && !IsSourceAlreadyProcessed(Source))
         {
             Source.WriteData(updatedText);
             IndexRecords.Add(IndexRecord);
         }
         else if (!CheckIndexBeforeUpdate)
         {
             Source.WriteData(updatedText);
             IndexRecords.Add(IndexRecord);
         }
     }
     finally
     {
         _sourceReadWriteLock.ExitWriteLock();
     }
 }
 public void Write(int threadId, string updatedText)
 {
     IndexRecords.Add(IndexRecord);
 }