public LockRequest(LockOperation op, LockMode mode, int timeout, ref DbEntry obj, Lock lck) { this.op = op; this.mode = mode; this.timeout = timeout; this.obj = obj; this.lck = lck; }
public void ReleaseLock(ref Lock lck) { DbRetVal ret; lock (rscLock) { DB_ENV* evp = CheckDisposed(); ret = evp->LockPut(evp, ref lck.dblck); } Util.CheckRetVal(ret); }
public static LockRequest ForRelease(Lock lck) { LockRequest lr = new LockRequest(); lr.op = LockOperation.Release; lr.lck = lck; return lr; }
public Lock AcquireLock(int locker, LockFlags flags, ref DbEntry obj, LockMode mode) { DbRetVal ret; Lock lck = new Lock(); lock (rscLock) { DB_ENV* evp = CheckDisposed(); fixed (byte* objBufP = obj.Buffer) { obj.dbt.data = objBufP + obj.Start; ret = evp->LockGet(evp, unchecked((uint)locker), unchecked((uint)flags), ref obj.dbt, (DB_LOCKMODE)mode, ref lck.dblck); } } if (ret != DbRetVal.SUCCESS) ThrowLockException(ret, -1); return lck; }