fix deadlock in rare cases when injecting an asset (#441)

This commit is contained in:
Jesse Plamondon-Willard 2018-02-16 22:33:33 -05:00
parent 789b2f4e42
commit d926133608
2 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@
* For modders:
* Fixed error when accessing a mod-provided API whose underlying class is `internal`.
* Fixed deadlock in rare cases when injecting a file with an asset loader.
* For SMAPI developers:
* All mod assemblies are now rewritten in-memory to support features like mod-provided APIs.

View File

@ -792,12 +792,12 @@ namespace StardewModdingAPI.Framework
{
try
{
this.Lock.EnterReadLock();
this.Lock.EnterWriteLock();
return action();
}
finally
{
this.Lock.ExitReadLock();
this.Lock.ExitWriteLock();
}
}
}