mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 14:23:40 +01:00
* wip * hacky fix for overlapping event text in profiler * move IsResumeGameAfterPluginLoad logic to PluginManager * fix some warnings * handle exceptions properly * remove ability to cancel, rename button to "hide" instead * undo Dalamud.Service refactor for now * warnings * add explainer, show which plugins are still loading * add some text if loading takes more than 3 minutes * undo wrong CS merge
28 lines
625 B
C#
28 lines
625 B
C#
using System.Threading;
|
|
|
|
namespace Dalamud.Utility;
|
|
|
|
/// <summary>
|
|
/// Scope for plugin list locks.
|
|
/// </summary>
|
|
public class ScopedSyncRoot : IDisposable
|
|
{
|
|
private readonly object lockObj;
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="ScopedSyncRoot"/> class.
|
|
/// </summary>
|
|
/// <param name="lockObj">The object to lock.</param>
|
|
public ScopedSyncRoot(object lockObj)
|
|
{
|
|
this.lockObj = lockObj;
|
|
Monitor.Enter(lockObj);
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public void Dispose()
|
|
{
|
|
GC.SuppressFinalize(this);
|
|
Monitor.Exit(this.lockObj);
|
|
}
|
|
}
|