The Old New Thing

Using opportunistic locks to get out of the way if somebody wants the file

Opportunistic locks allow you to be notified when somebody else tries to access a file you have open. This is usually done if you want to use a file provided nobody else wants it. For example, you might be a search indexer that wants to extract information from a file, but if somebody opens the file for writing, you don't want them to get ...