Skip to content

Commit

Permalink
Fixed a mistake in cache retrieval.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tape-Worm committed Oct 4, 2020
1 parent a74b794 commit fe2c3d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Gorgon/Gorgon.Graphics.Core/Textures/GorgonTextureCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ bool GetTextureFromCache(out T texture, out Lazy<TextureEntry> entry)
_graphics.Log.Print($"Requested texture '{textureName}' is currently being loaded on another thread, waiting for it to become available.", LoggingLevel.Verbose);

// If we're requesting a texture that's in the process of loading, then wait until the previous guy is done.
await Task.Run(() => SpinWait.SpinUntil(() => (!_scheduledTextures.Contains(textureName)) || (GetTextureFromCache(out _, out _))));
await Task.Run(() => SpinWait.SpinUntil(() => (!_scheduledTextures.Contains(textureName)) || (GetTextureFromCache(out result, out _))));
}

if ((result != null) || ((GetTextureFromCache(out result, out Lazy<TextureEntry> entry)) && (result != null)))
Expand Down

0 comments on commit fe2c3d3

Please sign in to comment.