All waiting threads are in a tight loop spinning on the lock.

From inspection of the code: This is a spin lock with no kernel call involved.

Therefore, it should not be used to lock a region for any significant length of time.

If you wanna know about all the magic hidden behind the code, read the article.

Unfortunately, the article is not any much clear about how to make it all work, so I decided to write this.

Does not state if there is any guaranteed sequencing, or that shared access can indefinitely starve exclusive requests, or what.

This documentation confusingly states Throws an invalid argument exception.

CEdit by doing a Get Window Text(), followed by the filtering, followedby a Set Window Text(), all within a routine fired from an ON_EN_CHANGEmessage.

I am developing this app on VC 7.1 under Win2K and it worksfine.

This could achieve by overriding the Pre Translate Message function on our CDialog derived class and thus we can easily process on messages sent to our window before they are hand over to child windows.