コード例 #1
0
 private bool ConcurrentDeleterLock(ref Key key, ref Value value, ref RecordInfo recordInfo, ref DeleteInfo deleteInfo, out bool lockFailed)
 {
     if (!recordInfo.LockExclusive())
     {
         lockFailed = true;
         return(false);
     }
     try
     {
         lockFailed = false;
         return(ConcurrentDeleterNoLock(ref key, ref value, ref recordInfo, ref deleteInfo));
     }
     finally
     {
         recordInfo.UnlockExclusive();
     }
 }
コード例 #2
0
 private bool ConcurrentWriterLock(ref Key key, ref Input input, ref Value src, ref Value dst, ref Output output, ref RecordInfo recordInfo, ref UpsertInfo upsertInfo, out bool lockFailed)
 {
     if (!recordInfo.LockExclusive())
     {
         lockFailed = true;
         return(false);
     }
     try
     {
         lockFailed = false;
         return(!recordInfo.Tombstone && ConcurrentWriterNoLock(ref key, ref input, ref src, ref dst, ref output, ref recordInfo, ref upsertInfo));
     }
     finally
     {
         recordInfo.UnlockExclusive();
     }
 }
コード例 #3
0
 private bool InPlaceUpdaterLock(ref Key key, ref Input input, ref Output output, ref Value value, ref RecordInfo recordInfo, ref RMWInfo rmwInfo, out bool lockFailed, out OperationStatus status)
 {
     if (!recordInfo.LockExclusive())
     {
         lockFailed = true;
         status     = OperationStatus.SUCCESS;
         return(false);
     }
     try
     {
         lockFailed = false;
         if (recordInfo.Tombstone)
         {
             status = OperationStatus.SUCCESS;
             return(false);
         }
         return(InPlaceUpdaterNoLock(ref key, ref input, ref output, ref value, ref recordInfo, ref rmwInfo, out status));
     }
     finally
     {
         recordInfo.UnlockExclusive();
     }
 }