I'd like to be able to overload the lock command so that I could log
an entry on lock and unlock. Any ideas on how to do this?
I think it would be powerful if you could inherit from a few keywords
in C# like this example:
static keyword MyLock : lock {
public MyLock(object obj) : base(obj) { log a message when entering
scope }
public ~MyLock() { log a message when going out of scope }
}
I could also see it being useful with the "using" keyword. I could see
it being very useful with try/catch/finally, but I think that would
conflict with the current method used for interrupting the code flow
(a painfully slow OS-level registration and interrupt).