RegisterCurrentThread() public static method

public static RegisterCurrentThread ( ) : void
return void
Esempio n. 1
0
        public void InForiegnFrame(Action action)
        {
            PrologCLR.RegisterCurrentThread();
            uint fid = libpl.PL_open_foreign_frame();

            try
            {
                action();
            }
            finally
            {
                // if (fid > 0) libpl.PL_close_foreign_frame(fid);
            }
        }
Esempio n. 2
0
        public override object CallPrologFast(object[] paramz)
        {
            PrologCLR.RegisterCurrentThread();
            var    results = paramz;
            PlTerm plC     = PlTerm.PlVar();

            libpl.PL_recorded(closureTerm, plC.TermRef);
            PlTerm ctestVars = plC.Arg(0);
            PlTerm ctestCode = plC.Arg(1);

            PlTerm[] terms  = PrologCLR.ToTermArray(ctestVars);
            int      idx    = terms.Length - 1;
            int      resdex = results.Length - 1;;

            while (idx >= 0 && resdex >= 0)
            {
                terms[idx--].FromObject(results[resdex--]);
            }
            PrologCLR.PlCall("user", "call", new PlTermV(ctestCode, 1));
            return(null);
        }
Esempio n. 3
0
 public IEnumerator <T> GetEnumerator()
 {
     PrologCLR.RegisterCurrentThread();
     return(new PrologBackedCollectionEnumerator(this));
 }
Esempio n. 4
0
 /// <summary>
 /// Returns an enumerator that iterates through the collection.
 /// </summary>
 /// <returns>
 /// A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection.
 /// </returns>
 /// <filterpriority>1</filterpriority>
 public IEnumerator <KeyValuePair <TKey, TValue> > GetEnumerator()
 {
     PrologCLR.RegisterCurrentThread();
     return(new PrologBackedDictionaryEnumerator(this));
 }