private void LockAndUndbindList()
{
if (_unbindList.Count == 0)
{
return;
}
// outside the lock so we may get a really strange value here.
// however. If we get 0 and the real value was something else, we will find out inside the lock in unbindlockedlist
// if we get !=0 and the real value was in fact 0, then we will just skip and then catch up next time around.
// however, doing things this way will save lots and lots of locks when the list is empty, which it should be if people have
// been using the dispose pattern correctly, or at least have been eager at disposing as soon as they can
// except of course dot notation users that cannot dispose cause they never get a reference in the first place
lock (_unbindListLock)
{
UnbindLockedList();
}
}