コード例 #1
0
 IntPtr GetPage(ref uint pageNo, Txn txn, CachePageGetFlags flags)
 {
     if (txn != null)
     {
         lock (txn.rscLock) {
             DB_TXN *txp = txn.CheckDisposed();
             return((IntPtr)GetPage(ref pageNo, txp, flags));
         }
     }
     else
     {
         return((IntPtr)GetPage(ref pageNo, (DB_TXN *)null, flags));
     }
 }
コード例 #2
0
 public Int64 Get(Txn txn, Int32 delta, ReadFlags flags)
 {
     if (txn != null)
     {
         lock (txn.rscLock) {
             DB_TXN *txp = txn.CheckDisposed();
             return(Get(txp, delta, flags));
         }
     }
     else
     {
         return(Get((DB_TXN *)null, delta, flags));
     }
 }
コード例 #3
0
        public void Open(Txn txn, ref DbEntry key, OpenFlags flags)
        {
            DbRetVal ret;

            if (txn != null)
            {
                lock (txn.rscLock) {
                    DB_TXN *txp = txn.CheckDisposed();
                    ret = Open(txp, ref key, flags);
                }
            }
            else
            {
                ret = Open((DB_TXN *)null, ref key, flags);
            }
            Util.CheckRetVal(ret);
        }
コード例 #4
0
        public void Remove(Txn txn, RemoveFlags flags)
        {
            DbRetVal ret;

            if (txn != null)
            {
                lock (txn.rscLock) {
                    DB_TXN *txp = txn.CheckDisposed();
                    ret = Remove(txp, flags);
                }
            }
            else
            {
                ret = Remove((DB_TXN *)null, flags);
            }
            GC.SuppressFinalize(this);
            Util.CheckRetVal(ret);
        }
コード例 #5
0
 public void Remove(Txn txn, RemoveFlags flags) {
   DbRetVal ret;
   if (txn != null) {
     lock (txn.rscLock) {
       DB_TXN* txp = txn.CheckDisposed();
       ret = Remove(txp, flags);
     }
   }
   else
     ret = Remove((DB_TXN*)null, flags);
   GC.SuppressFinalize(this);
   Util.CheckRetVal(ret);
 }
コード例 #6
0
 public Int64 Get(Txn txn, Int32 delta, ReadFlags flags) {
   if (txn != null) {
     lock (txn.rscLock) {
       DB_TXN* txp = txn.CheckDisposed();
       return Get(txp, delta, flags);
     }
   }
   else
     return Get((DB_TXN*)null, delta, flags);
 }
コード例 #7
0
 public void Open(Txn txn, ref DbEntry key, OpenFlags flags) {
   DbRetVal ret;
   if (txn != null) {
     lock (txn.rscLock) {
       DB_TXN* txp = txn.CheckDisposed();
       ret = Open(txp, ref key, flags);
     }
   }
   else
     ret = Open((DB_TXN*)null, ref key, flags);
   Util.CheckRetVal(ret);
 }
コード例 #8
0
 IntPtr GetPage(ref uint pageNo, Txn txn, CachePageGetFlags flags) {
   if (txn != null) {
     lock (txn.rscLock) {
       DB_TXN* txp = txn.CheckDisposed();
       return (IntPtr)GetPage(ref pageNo, txp, flags);
     }
   }
   else
     return (IntPtr)GetPage(ref pageNo, (DB_TXN*)null, flags);
 }
コード例 #9
0
 public void LogPrintFile(Txn txn, string msg) {
   byte[] msgBytes = null;
   int count = Util.StrToUtf8(msg, ref msgBytes);
   if (txn != null) {
     lock (txn.rscLock) {
       DB_TXN* txp = txn.CheckDisposed();
       LogPrintFile(txp, msgBytes);
     }
   }
   else
     LogPrintFile(null, msgBytes);
 }
コード例 #10
0
 public Txn TxnBegin(Txn parent, Txn.BeginFlags flags) {
   Txn txn = new Txn(this);
   DbRetVal ret;
   // lock environement first, to avoid deadlocks
   lock (rscLock) {
     if (parent != null) {
       lock (parent.rscLock) {
         DB_TXN* parxp = parent.CheckDisposed();
         ret = TxnBegin(parxp, txn, flags);
       }
     }
     else
       ret = TxnBegin(null, txn, flags);
   }
   Util.CheckRetVal(ret);
   return txn;
 }
コード例 #11
0
    public void DbRename(Txn txn, string file, string database, string newname, WriteFlags flags) {
      byte[] fBytes = null;
      Util.StrToUtf8(file, ref fBytes);
      byte[] dBytes = null;
      Util.StrToUtf8(database, ref dBytes);
      byte[] nBytes = null;
      Util.StrToUtf8(newname, ref nBytes);

      DbRetVal ret;
      // lock environement first, to avoid deadlocks
      lock (rscLock) {
        if (txn != null) {
          lock (txn.rscLock) {
            DB_TXN* txp = txn.CheckDisposed();
            ret = DbRename(txp, fBytes, dBytes, nBytes, flags);
          }
        }
        else
          ret = DbRename(null, fBytes, dBytes, nBytes, flags);
      }
      Util.CheckRetVal(ret);
    }