public static void ReleaseHandle(ContextHandle hnd)
 {
     lock (NonDetHandles)
     {
         NondetContextHandle.ContextToObject.Remove(hnd.Context);
         hnd.Context = (IntPtr)0;
         NonDetHandles.AddLast(hnd);
     }
 }
 public virtual bool Close(ContextHandle handle, PlTermV a0)
 {
     bool res = handle.Close(a0);
     return res;
 }
 public virtual NDCCH New(ContextHandle handle, PlTermV a0)
 {
     handle.Setup(a0);
     return (NDCCH)handle.ManagedObject;
 }
 public virtual int Call0(ContextHandle handle, PlTermV termV)
 {
     bool res = handle.Call(termV);
     bool more = handle.HasMore();
     if (more)
     {
         libpl.PL_retry(handle.Handle);
         return res ? 3 : 0;
     }
     return res ? 1 : 0;
 }