From a729518a66eaaf44cb98adb26cd558160dbb2df5 Mon Sep 17 00:00:00 2001 From: wj32 Date: Sat, 22 Aug 2009 05:39:14 +0000 Subject: [PATCH] removed FastResourceLock.cs git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1732 21ef857c-d57f-4fe0-8362-d861dc6d29cd --- .../ProcessHacker.Common.csproj | 1 - .../Threading/FastResourceLock.cs | 99 ------------------- 2 files changed, 100 deletions(-) delete mode 100644 trunk/ProcessHacker.Common/Threading/FastResourceLock.cs diff --git a/trunk/ProcessHacker.Common/ProcessHacker.Common.csproj b/trunk/ProcessHacker.Common/ProcessHacker.Common.csproj index ddaebb500..8866cb027 100644 --- a/trunk/ProcessHacker.Common/ProcessHacker.Common.csproj +++ b/trunk/ProcessHacker.Common/ProcessHacker.Common.csproj @@ -71,7 +71,6 @@ - diff --git a/trunk/ProcessHacker.Common/Threading/FastResourceLock.cs b/trunk/ProcessHacker.Common/Threading/FastResourceLock.cs deleted file mode 100644 index f84ce94ba..000000000 --- a/trunk/ProcessHacker.Common/Threading/FastResourceLock.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ProcessHacker.Common.Threading -{ - public unsafe class FastResourceLock - { - // Indicates that the lock is held. - private const int _locked = 0x1; - // Indicates that there are chained waiters. - private const int _waiters = 0x2; - // Flags mask. - private const int _flags = 0x3; - - private int _spinCount; - private void* _value; - - public struct FastResourceLockContext : IDisposable - { - private bool _disposed; - private FastResourceLock _lock; - private bool _shared; - - internal FastResourceLockContext(FastResourceLock loc, bool shared) - { - _disposed = false; - _lock = loc; - _shared = shared; - } - - public void Dispose() - { - if (!_disposed) - { - if (_shared) - _lock.ReleaseShared(); - else - _lock.ReleaseExclusive(); - - _disposed = true; - } - } - } - - public struct FastResourceWaitBlock - { - public FastResourceWaitBlock* Previous; - public FastResourceWaitBlock* Next; - public FastResourceWaitBlock* Last; - - public int SharedCount; - - public IntPtr WakeEventHandle; - } - - public FastResourceLock() - { - _value = null; - - if (Environment.ProcessorCount == 1) - _spinCount = 0; - else - _spinCount = 1024; - } - - public void AcquireExclusive() - { - - } - - public FastResourceLockContext AcquireExclusiveContext() - { - this.AcquireExclusive(); - return new FastResourceLockContext(this, false); - } - - public void AcquireShared() - { - - } - - public FastResourceLockContext AcquireSharedContext() - { - this.AcquireShared(); - return new FastResourceLockContext(this, true); - } - - public void ReleaseExclusive() - { - - } - - public void ReleaseShared() - { - - } - } -}