I am quite new to C# and threading, and I have this problem to resolve:
I have a thread which processes some data and from time to time (when necessary) it fires my event method (DataProcessor) which was set before starting the thread. This thread is in proprietary dll. So I cannot affect DataProcessor calling anymore.
public void DataProcessor(object sender) { //... //do some stuff which take some time } My problem is that from time to time when DataProcessor is fired and starts doing some stuff and it's not finished yet, it's fired again and I have a conflict.
What I need is, when DataProcessor is doing some stuff all other data is unnecessary so all other attempts to process another data MUST be ignored/skipped - are not relevant for processing.