Remove never defined FEATURE_RWLOCK
authordanmosemsft <danmose@microsoft.com>
Wed, 15 Feb 2017 06:24:54 +0000 (22:24 -0800)
committerdanmosemsft <danmose@microsoft.com>
Wed, 15 Feb 2017 06:26:07 +0000 (22:26 -0800)
Commit migrated from https://github.com/dotnet/coreclr/commit/1c71abf702b27c34ce941c347d1b2fdee56d6c48

src/coreclr/src/vm/binder.cpp
src/coreclr/src/vm/ceemain.cpp
src/coreclr/src/vm/corhost.cpp
src/coreclr/src/vm/ecalllist.h
src/coreclr/src/vm/mscorlib.cpp
src/coreclr/src/vm/mscorlib.h
src/coreclr/src/vm/rwlock.h [deleted file]
src/coreclr/src/vm/securitypolicy.h
src/coreclr/src/vm/synch.cpp
src/coreclr/src/vm/synch.h

index 3c95d76..0a273d0 100644 (file)
@@ -13,7 +13,6 @@
 #include "field.h"
 #include "excep.h"
 #include "eeconfig.h"
-#include "rwlock.h"
 #include "runtimehandles.h"
 #include "customattribute.h"
 #include "debugdebugger.h"
index 53d4ee1..0cf57bf 100644 (file)
 #include "comdelegate.h"
 #include "appdomain.hpp"
 #include "perfcounters.h"
-#include "rwlock.h"
 #ifdef FEATURE_IPCMAN
 #include "ipcmanagerinterface.h"
 #endif // FEATURE_IPCMAN
@@ -877,10 +876,6 @@ void EEStartupHelper(COINITIEE fFlags)
         g_pEEShutDownEvent = new CLREvent();
         g_pEEShutDownEvent->CreateManualEvent(FALSE);
 
-#ifdef FEATURE_RWLOCK
-        // Initialize RWLocks
-        CRWLock::ProcessInit();
-#endif // FEATURE_RWLOCK
 
 
 #ifdef FEATURE_IPCMAN
index 1777151..daf9856 100644 (file)
@@ -19,7 +19,6 @@
 #include "eeconfig.h"
 #include "dbginterface.h"
 #include "ceemain.h"
-#include "rwlock.h"
 #include "hosting.h"
 #include "eepolicy.h"
 #include "clrex.h"
index afff573..7ad9539 100644 (file)
@@ -71,24 +71,6 @@ FCFuncStart(gDependentHandleFuncs)
 FCFuncEnd()
 
 
-#ifdef FEATURE_RWLOCK
-FCFuncStart(gRWLockFuncs)
-    FCFuncElement("AcquireReaderLockInternal",  CRWLock::StaticAcquireReaderLockPublic)
-    FCFuncElement("AcquireWriterLockInternal",  CRWLock::StaticAcquireWriterLockPublic)
-    FCFuncElement("ReleaseReaderLockInternal",  CRWLock::StaticReleaseReaderLockPublic)
-    FCFuncElement("ReleaseWriterLockInternal",  CRWLock::StaticReleaseWriterLockPublic)
-    FCFuncElement("FCallUpgradeToWriterLock",  CRWLock::StaticDoUpgradeToWriterLockPublic)
-    FCFuncElement("DowngradeFromWriterLockInternal",  CRWLock::StaticDowngradeFromWriterLock)
-    FCFuncElement("FCallReleaseLock",  CRWLock::StaticDoReleaseLock)
-    FCFuncElement("RestoreLockInternal",  CRWLock::StaticRestoreLockPublic)
-    FCFuncElement("PrivateGetIsReaderLockHeld",  CRWLock::StaticIsReaderLockHeld)
-    FCFuncElement("PrivateGetIsWriterLockHeld",  CRWLock::StaticIsWriterLockHeld)
-    FCFuncElement("PrivateGetWriterSeqNum",  CRWLock::StaticGetWriterSeqNum)
-    FCFuncElement("AnyWritersSince",  CRWLock::StaticAnyWritersSince)
-    FCFuncElement("PrivateInitialize",  CRWLock::StaticPrivateInitialize)
-    FCFuncElement("PrivateDestruct",  CRWLock::StaticPrivateDestruct)
-FCFuncEnd()
-#endif // FEATURE_RWLOCK
 
 
 
@@ -1505,9 +1487,6 @@ FCClassElement("ParseNumbers", "System", gParseNumbersFuncs)
 
 
 FCClassElement("PunkSafeHandle", "System.Reflection.Emit", gSymWrapperCodePunkSafeHandleFuncs)
-#ifdef FEATURE_RWLOCK
-FCClassElement("ReaderWriterLock", "System.Threading", gRWLockFuncs)
-#endif  // FEATURE_RWLOCK
 FCClassElement("RegisteredWaitHandleSafe", "System.Threading", gRegisteredWaitHandleFuncs)
 #ifdef FEATURE_COMINTEROP
 #ifdef FEATURE_COMINTEROP_MANAGED_ACTIVATION
index a2d33f9..4d98eba 100644 (file)
@@ -50,7 +50,6 @@
 #include "debugdebugger.h"
 #include "assemblyname.hpp"
 #include "assemblynative.hpp"
-#include "rwlock.h"
 #include "comthreadpool.h"
 #include "comwaithandle.h"
 #include "nativeoverlapped.h"
index 86af1a4..2e90c3b 100644 (file)
@@ -893,20 +893,6 @@ DEFINE_METHOD(PROPERTY,             GET_GETTER,             GetGetMethod,
 DEFINE_CLASS(PROPERTY_INFO,         Reflection,             PropertyInfo)
 
 
-#ifdef FEATURE_RWLOCK
-DEFINE_CLASS_U(Threading,              ReaderWriterLock,           CRWLock)
-DEFINE_FIELD_U(_hWriterEvent,              CRWLock, _hWriterEvent)
-DEFINE_FIELD_U(_hReaderEvent,              CRWLock, _hReaderEvent)
-DEFINE_FIELD_U(_hObjectHandle,             CRWLock, _hObjectHandle)
-DEFINE_FIELD_U(_dwState,                   CRWLock, _dwState)
-DEFINE_FIELD_U(_dwULockID,                 CRWLock, _dwULockID)
-DEFINE_FIELD_U(_dwLLockID,                 CRWLock, _dwLLockID)
-DEFINE_FIELD_U(_dwWriterID,                CRWLock, _dwWriterID)
-DEFINE_FIELD_U(_dwWriterSeqNum,            CRWLock, _dwWriterSeqNum)
-DEFINE_FIELD_U(_wWriterLevel,              CRWLock, _wWriterLevel)
-#endif  // FEATURE_RWLOCK
-
-
 
 DEFINE_CLASS(METADATA_IMPORT,       Reflection,             MetadataImport)
 DEFINE_METHOD(METADATA_IMPORT,      THROW_ERROR,            ThrowError,                 SM_Int_RetVoid)
diff --git a/src/coreclr/src/vm/rwlock.h b/src/coreclr/src/vm/rwlock.h
deleted file mode 100644 (file)
index 908e007..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//
-
-// 
-//+-------------------------------------------------------------------
-//
-//  File:       RWLock.h
-//
-//  Contents:   Reader writer lock implementation that supports the
-//              following features
-//                  1. Cheap enough to be used in large numbers
-//                     such as per object synchronization.
-//                  2. Supports timeout. This is a valuable feature
-//                     to detect deadlocks
-//                  3. Supports caching of events. The allows
-//                     the events to be moved from least contentious
-//                     regions to the most contentious regions.
-//                     In other words, the number of events needed by
-//                     Reader-Writer lockls is bounded by the number
-//                     of threads in the process.
-//                  4. Supports nested locks by readers and writers
-//                  5. Supports spin counts for avoiding context switches
-//                     on  multi processor machines.
-//                  6. Supports functionality for upgrading to a writer
-//                     lock with a return argument that indicates
-//                     intermediate writes. Downgrading from a writer
-//                     lock restores the state of the lock.
-//                  7. Supports functionality to Release Lock for calling
-//                     app code. RestoreLock restores the lock state and
-//                     indicates intermediate writes.
-//                  8. Recovers from most common failures such as creation of
-//                     events. In other words, the lock mainitains consistent
-//                     internal state and remains usable
-//
-//  Classes:    CRWLock,
-//              CStaticRWLock
-// 
-//--------------------------------------------------------------------
-
-#ifdef FEATURE_RWLOCK
-#ifndef _RWLOCK_H_
-#define _RWLOCK_H_
-#include "common.h"
-#include "threads.h"
-
-// If you do define this, make sure you define this in managed as well.
-//#define RWLOCK_STATISTICS     0
-
-extern DWORD gdwDefaultTimeout;
-extern DWORD gdwDefaultSpinCount;
-
-
-//+-------------------------------------------------------------------
-//
-//  Struct:     LockCookie
-//
-//  Synopsis:   Lock cookies returned to the client
-//
-//+-------------------------------------------------------------------
-typedef struct {
-    DWORD dwFlags;
-    DWORD dwWriterSeqNum;
-    WORD wReaderLevel;
-    WORD wWriterLevel;
-    DWORD dwThreadID;
-} LockCookie;
-
-#endif // _RWLOCK_H_
-
-#endif // FEATURE_RWLOCK
-
index 2ba739f..d13ab04 100644 (file)
@@ -17,7 +17,6 @@
 #include "fcall.h"
 #include "qcall.h"
 #include "cgensys.h"
-#include "rwlock.h"
 
 #define SPFLAGSASSERTION        0x01
 #define SPFLAGSUNMANAGEDCODE    0x02
index 33ae636..eaee72b 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "corhost.h"
 #include "synch.h"
-#include "rwlock.h"
 
 void CLREventBase::CreateAutoEvent (BOOL bInitialState  // If TRUE, initial state is signalled
                                 )
@@ -211,77 +210,6 @@ void CLREventBase::SetMonitorEvent()
     }
 }
 
-#ifdef FEATURE_RWLOCK
-void CLREventBase::CreateRWLockWriterEvent (BOOL bInitialState,  // If TRUE, initial state is signalled
-                                        CRWLock *pRWLock
-                                )
-{
-    CONTRACTL
-    {
-        THROWS;           
-        GC_NOTRIGGER;
-        // disallow creation of Crst before EE starts
-        PRECONDITION((g_fEEStarted));        
-        PRECONDITION((m_handle == INVALID_HANDLE_VALUE));        
-        PRECONDITION((GetThread() != NULL));        
-        PRECONDITION((!IsOSEvent()));
-    }
-    CONTRACTL_END;
-
-    SetAutoEvent();
-
-    {
-        HANDLE h = UnsafeCreateEvent(NULL,FALSE,bInitialState,NULL);
-        if (h == NULL) {
-            ThrowOutOfMemory();
-        }
-        m_handle = h;
-    }
-
-    SetInDeadlockDetection();
-}
-
-void CLREventBase::CreateRWLockReaderEvent (BOOL bInitialState,  // If TRUE, initial state is signalled
-                                        CRWLock *pRWLock
-                                )
-{
-    CONTRACTL
-    {
-        THROWS;           
-        GC_NOTRIGGER;
-        // disallow creation of Crst before EE starts
-        PRECONDITION((g_fEEStarted));        
-        PRECONDITION((m_handle == INVALID_HANDLE_VALUE));        
-        PRECONDITION((GetThread() != NULL));        
-        PRECONDITION((!IsOSEvent()));
-    }
-    CONTRACTL_END;
-
-    IHostSyncManager *pManager = CorHost2::GetHostSyncManager();
-    if (pManager == NULL) {
-        HANDLE h = UnsafeCreateEvent(NULL,TRUE,bInitialState,NULL);
-        if (h == NULL) {
-            ThrowOutOfMemory();
-        }
-        m_handle = h;
-    }
-    else {
-        IHostManualEvent *pEvent;
-        HRESULT hr;
-        SIZE_T cookie = (SIZE_T)pRWLock->GetObjectHandle();
-        BEGIN_SO_TOLERANT_CODE_CALLING_HOST(GetThread());
-        hr = pManager->CreateRWLockReaderEvent(bInitialState, cookie, &pEvent);
-        END_SO_TOLERANT_CODE_CALLING_HOST;
-        if (hr != S_OK) {
-            _ASSERTE (hr == E_OUTOFMEMORY);
-            ThrowOutOfMemory();
-        }
-        m_handle = (HANDLE)pEvent;
-    }
-
-    SetInDeadlockDetection();
-}
-#endif // FEATURE_RWLOCK
 
 
 void CLREventBase::CreateOSAutoEvent (BOOL bInitialState  // If TRUE, initial state is signalled
index 8605eea..1411a46 100644 (file)
@@ -42,10 +42,6 @@ public:
 
     void CreateMonitorEvent(SIZE_T Cookie); // robust against initialization races - for exclusive use by AwareLock
 
-#ifdef FEATURE_RWLOCK
-    void CreateRWLockReaderEvent(BOOL bInitialState, CRWLock* pRWLock);
-    void CreateRWLockWriterEvent(BOOL bInitialState, CRWLock* pRWLock);
-#endif
 
     // Create an Event that is not host aware
     void CreateOSAutoEvent (BOOL bInitialState);