I don't think it will be much of a problem that you walk again through the list. Since you now prevent the queue from filling up with a lot of duplicates the queue will in general be quite short (unless a lot different files change at the same time).
In its current form it will probably hang though, since the while loop will only terminate if you remove all events from the queue which is not very likely to happen.
I don't think it will be much of a problem that you walk again through the list. Since you now prevent the queue from filling up with a lot of duplicates the queue will in general be quite short (unless a lot different files change at the same time).
In its current form it will probably hang though, since the while loop will only terminate if you remove all events from the queue which is not very likely to happen.