Unbind() protected abstract method

Override Unbind and put in code that actually calls core and unbinds whatever this handle is about. when this is called, it has already been verified that it is safe to call core - so just put in code that does the job.
protected abstract Unbind ( ) : void
return void
Exemplo n.º 1
0
 /// <summary>
 /// Called by children to this root, when they would like to
 /// be unbound, but are (possibly) running in a finalizer thread
 /// so it is (possibly) not safe to unbind then directly.
 /// </summary>
 /// <param name="handleToUnbind">The core handle that is not needed anymore and should be unbound.</param>
 private void RequestUnbind(RealmHandle handleToUnbind)
 {
     lock (_unbindListLock) // You can lock a lock several times inside the same thread. The top-level-lock is the one that counts
     {
         // first let's see if we should go to the list or not
         if (_noMoreUserThread)
         {
             UnbindLockedList();
             handleToUnbind.Unbind();
         }
         else
         {
             _unbindList.Add(handleToUnbind); // resurrects handleToUnbind - but it is never a root object bc RequestUnbind is always called above with root.
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Called by children to this root, when they would like to 
 /// be unbound, but are (possibly) running in a finalizer thread 
 /// so it is (possibly) not safe to unbind then directly.
 /// </summary>
 /// <param name="handleToUnbind">The core handle that is not needed anymore and should be unbound.</param>
 private void RequestUnbind(RealmHandle handleToUnbind)
 {
     lock (_unbindListLock) // You can lock a lock several times inside the same thread. The top-level-lock is the one that counts
     {
         // first let's see if we should go to the list or not
         if (_noMoreUserThread)
         {
             UnbindLockedList();
             handleToUnbind.Unbind();
         }
         else
         {
             _unbindList.Add(handleToUnbind); // resurrects handleToUnbind - but it is never a root object bc RequestUnbind is always called above with root.
         }
     }
 }