mirror of
https://github.com/SK-la/osu-framework.git
synced 2026-03-15 03:20:30 +00:00
Remove nullable disable annotation and mark some properties as nullable.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using osu.Framework.Statistics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using osu.Framework.Statistics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Development;
|
||||
using osu.Framework.Platform;
|
||||
@@ -68,8 +65,7 @@ namespace osu.Framework.Threading
|
||||
/// in <see cref="ExecutionMode.SingleThread"/> execution mode <see cref="ThreadRunner"/> drives its <see cref="GameThread"/>s
|
||||
/// manually and sequentially on the main OS thread of the game process.
|
||||
/// </summary>
|
||||
[CanBeNull]
|
||||
public Thread Thread { get; private set; }
|
||||
public Thread? Thread { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The thread's scheduler.
|
||||
@@ -80,7 +76,7 @@ namespace osu.Framework.Threading
|
||||
/// Attach a handler to delegate responsibility for per-frame exceptions.
|
||||
/// While attached, all exceptions will be caught and forwarded. Thread execution will continue indefinitely.
|
||||
/// </summary>
|
||||
public EventHandler<UnhandledExceptionEventArgs> UnhandledException;
|
||||
public EventHandler<UnhandledExceptionEventArgs>? UnhandledException;
|
||||
|
||||
/// <summary>
|
||||
/// A synchronisation context which posts to this thread.
|
||||
@@ -141,14 +137,14 @@ namespace osu.Framework.Threading
|
||||
|
||||
private readonly GameThreadSynchronizationContext synchronizationContext;
|
||||
|
||||
internal PerformanceMonitor Monitor { get; }
|
||||
internal PerformanceMonitor? Monitor { get; }
|
||||
|
||||
internal virtual IEnumerable<StatisticsCounterType> StatisticsCounters => Array.Empty<StatisticsCounterType>();
|
||||
|
||||
/// <summary>
|
||||
/// The main work which is fired on each frame.
|
||||
/// </summary>
|
||||
protected event Action OnNewFrame;
|
||||
protected event Action? OnNewFrame;
|
||||
|
||||
private readonly ManualResetEvent initializedEvent = new ManualResetEvent(false);
|
||||
|
||||
@@ -164,7 +160,7 @@ namespace osu.Framework.Threading
|
||||
/// </summary>
|
||||
private volatile bool exitRequested;
|
||||
|
||||
internal GameThread(Action onNewFrame = null, string name = "unknown", bool monitorPerformance = true)
|
||||
internal GameThread(Action? onNewFrame = null, string name = "unknown", bool monitorPerformance = true)
|
||||
{
|
||||
OnNewFrame = onNewFrame;
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace osu.Framework.Threading
|
||||
{
|
||||
internal class GameThreadScheduler : Scheduler
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using osu.Framework.Platform;
|
||||
|
||||
namespace osu.Framework.Threading
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using osu.Framework.Statistics;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Development;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using osu.Framework.Statistics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -13,9 +11,9 @@ namespace osu.Framework.Threading
|
||||
{
|
||||
public class UpdateThread : GameThread
|
||||
{
|
||||
private readonly DrawThread drawThread;
|
||||
private readonly DrawThread? drawThread;
|
||||
|
||||
public UpdateThread(Action onNewFrame, DrawThread drawThread)
|
||||
public UpdateThread(Action onNewFrame, DrawThread? drawThread)
|
||||
: base(onNewFrame, "Update")
|
||||
{
|
||||
this.drawThread = drawThread;
|
||||
|
||||
Reference in New Issue
Block a user