Commits

rimmington  committed d882aa5 Draft

made ReaderWriterLock mutexes protected internal instead of internal; some comment clarifications

  • Participants
  • Parent commits 996bc5a

Comments (0)

Files changed (5)

File Cineraria.Caching/GlobalSuppressions.cs

-// This file is used by Code Analysis to maintain SuppressMessage
+// <auto-generated />
+// This file is used by Code Analysis to maintain SuppressMessage
 // attributes that are applied to this project.
 // Project-level suppressions either have no target or are given
 // a specific target and scoped to a namespace, type, member, etc.

File Cineraria.Concurrency/Cineraria.Concurrency.csproj

     <Compile Include="BrokenBarrierException.cs" />
     <Compile Include="Channel.cs" />
     <Compile Include="FifoSemaphore.cs" />
+    <Compile Include="GlobalSuppressions.cs" />
     <Compile Include="IReaderWriterLock.cs" />
     <Compile Include="IReadableChannel.cs" />
     <Compile Include="ISync.cs" />

File Cineraria.Concurrency/GlobalSuppressions.cs

+// This file is used by Code Analysis to maintain SuppressMessage 
+// attributes that are applied to this project.
+// Project-level suppressions either have no target or are given 
+// a specific target and scoped to a namespace, type, member, etc.
+//
+// To add a suppression to this file, right-click the message in the 
+// Error List, point to "Suppress Message(s)", and click 
+// "In Project Suppression File".
+// You do not need to add suppressions to this file manually.
+
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Scope = "member", Target = "Cineraria.Concurrency.ReaderWriterLock.#ReadPermission")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "Cineraria.Concurrency.ReaderWriterLock.#ReadPermission")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Scope = "member", Target = "Cineraria.Concurrency.ReaderWriterLock.#Turnstile")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "Cineraria.Concurrency.ReaderWriterLock.#Turnstile")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Scope = "member", Target = "Cineraria.Concurrency.ReaderWriterLock.#WritePermission")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "Cineraria.Concurrency.ReaderWriterLock.#WritePermission")]

File Cineraria.Concurrency/ReaderWriterLock.cs

         /// <summary>
         /// A semaphore representing permission to read.
         /// </summary>
-        internal readonly Mutex WritePermission = new Mutex(1);
+        protected internal readonly Mutex WritePermission = new Mutex(1);
 
         /// <summary>
         /// A turnstile used to give writers and readers equal priority.
         /// </summary>
-        internal readonly Mutex Turnstile = new Mutex(1);
+        protected internal readonly Mutex Turnstile = new Mutex(1);
 
         /// <summary>
         /// A lightswitch representing permission to read.
         /// </summary>
-        internal readonly Lightswitch ReadPermission;
+        protected internal readonly Lightswitch ReadPermission;
 
         /// <summary>
         /// Initializes a new instance of the <see cref="ReaderWriterLock"/>

File Cineraria.Concurrency/ReaderWriterUpdateLock.cs

             }
 
             // Since AcquireWriter and AcquireReader acquire the turnstile
-            // their respective permissions, ReadPermission can be released
-            // here without another thread acqiring WritePermission before this
-            // one.
+            // before their respective permissions, ReadPermission can be
+            // released here without another thread acqiring WritePermission
+            // before this one.
             this.ReadPermission.Release();
             this.WritePermission.Acquire();
             this._updatePermission.Release();