Not that rare in my experience, I constantly had to write software like this. Not every day, but it certainly did come up quite often in my code and others'
Oh and oone more thing - the very (developer-managed) complexity makes it that people constantly got it wrong, usually just enough (as often with the case of threading) that it worked fine 90% of the time, and was very hard to make a case to management why we should invest effort into fixing it.