How do I perform a lock
based on a specific string-key?
public void PerformUpdate(string key)
{
// TODO: Refine this, since they key-string won't
// be the same instance between calls
lock(key)
{
PerformUpdateImpl()
}
}
I've tried to keep lock-objects in a ConcurrentDictionary
, but somehow this doesn't hold up either.