Fix load bug where exactly one image per thread would not get loaded

This commit is contained in:
Magnus Norddahl 2020-01-12 23:35:20 +01:00
parent fc7093b959
commit a2b18f1893

View file

@ -749,8 +749,10 @@ namespace CodeImp.DoomBuilder.Data
lock(syncobject) lock(syncobject)
{ {
// Fetch next image to process // Fetch next image to process
if(imageque.Count > 0) image = imageque.Dequeue(); if(imageque.Count > 0)
if (imageque.Count == 0) Monitor.Wait(syncobject); image = imageque.Dequeue();
else
Monitor.Wait(syncobject);
} }
image?.BackgroundLoadImage(); image?.BackgroundLoadImage();