File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
Microsoft.Toolkit.Uwp.Input.GazeInteraction Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change 6
6
using System . Collections . Generic ;
7
7
using System . Diagnostics ;
8
8
using System . Linq ;
9
+ using System . Threading ;
9
10
using System . Threading . Tasks ;
10
11
using Windows . Devices . Input . Preview ;
11
12
using Windows . Foundation ;
@@ -298,20 +299,9 @@ internal int CursorRadius
298
299
/// </summary>
299
300
public bool IsAlwaysActivated { get ; set ; }
300
301
301
- private static GazePointer _instance = null ;
302
+ private static ThreadLocal < GazePointer > _instance = new ThreadLocal < GazePointer > ( ( ) => new GazePointer ( ) ) ;
302
303
303
- internal static GazePointer Instance
304
- {
305
- get
306
- {
307
- if ( _instance == null )
308
- {
309
- _instance = new GazePointer ( ) ;
310
- }
311
-
312
- return _instance ;
313
- }
314
- }
304
+ internal static GazePointer Instance => _instance . Value ;
315
305
316
306
internal void AddRoot ( int proxyId )
317
307
{
You can’t perform that action at this time.
0 commit comments