I'm logging values in memory to a list type structure, and would like to keep only the items collected within the last hour. This is in an asp.net mvc app, so the list is static and access by multiple threads. I'm currently checking every 80 minutes and will delete only the ones older than 60 minutes (just so it's not performed on every request). I have a lock around the code that walks through the structure to find old values, collects these to a temp holder, then removes them from the original structure.
I seem to be getting some locking issues with this, so was curious if there is some kind of built-in structure or some bulletproof code that would assist me with doing this, instead of trying to hand code it.