This is mostly for curiosity's sake, as there are better ways of implementing almost any use case I can think of for this construct (in C# and other languages I use regularly, at least), but I recently saw on here a scoped mutex which was a cool concept.
My question is, does the using statement maintain a reference (ie: prevent the GC from running on) to the object it's acting on?
For example, if I were to do:
using (new ScopedMutex())
{
// ...
}
would the ScopedMutex object maintain its existence to the end of the using block, or could the GC run and dispose of it mid-block?