Here’s a bit of code I extracted from my own special baby of an application. It allows me to lock on a specific "name", rather than having to use an object instance and the built in lock construct.
Usage
NamedLock<string> locker = new NamedLock<string>();
var url = "http://services.digg.com…";
using (locker.Lock(url))
{
//Do something synchronized
[...]
-
Home > Caching