Procházet zdrojové kódy

misc: chore: convert split ThreadStatic fields & property getter/setters into a single property with [field: ThreadStatic]

Evan Husted před 1 rokem
rodič
revize
d8549f687b
1 změnil soubory, kde provedl 15 přidání a 21 odebrání
  1. 15 21
      src/Ryujinx.Horizon/HorizonStatic.cs

+ 15 - 21
src/Ryujinx.Horizon/HorizonStatic.cs

@@ -17,27 +17,21 @@ namespace Ryujinx.Horizon
             }.Start();
         
         public static event Action<MessagePackObject> PlayReport;
-        
-        [ThreadStatic]
-        private static HorizonOptions _options;
 
-        [ThreadStatic]
-        private static ISyscallApi _syscall;
+        [field: ThreadStatic]
+        public static HorizonOptions Options { get; private set; }
 
-        [ThreadStatic]
-        private static IVirtualMemoryManager _addressSpace;
+        [field: ThreadStatic]
+        public static ISyscallApi Syscall { get; private set; }
 
-        [ThreadStatic]
-        private static IThreadContext _threadContext;
+        [field: ThreadStatic]
+        public static IVirtualMemoryManager AddressSpace { get; private set; }
 
-        [ThreadStatic]
-        private static int _threadHandle;
+        [field: ThreadStatic]
+        public static IThreadContext ThreadContext { get; private set; }
 
-        public static HorizonOptions Options => _options;
-        public static ISyscallApi Syscall => _syscall;
-        public static IVirtualMemoryManager AddressSpace => _addressSpace;
-        public static IThreadContext ThreadContext => _threadContext;
-        public static int CurrentThreadHandle => _threadHandle;
+        [field: ThreadStatic]
+        public static int CurrentThreadHandle { get; private set; }
 
         public static void Register(
             HorizonOptions options,
@@ -46,11 +40,11 @@ namespace Ryujinx.Horizon
             IThreadContext threadContext,
             int threadHandle)
         {
-            _options = options;
-            _syscall = syscallApi;
-            _addressSpace = addressSpace;
-            _threadContext = threadContext;
-            _threadHandle = threadHandle;
+            Options = options;
+            Syscall = syscallApi;
+            AddressSpace = addressSpace;
+            ThreadContext = threadContext;
+            CurrentThreadHandle = threadHandle;
         }
     }
 }