Commit 022d21a3 张东亮

视觉检测锁修改

1 个父辈 5fc9789c
...@@ -259,6 +259,8 @@ namespace DeviceLibrary ...@@ -259,6 +259,8 @@ namespace DeviceLibrary
int retrytime = 0; int retrytime = 0;
if (Monitor.TryEnter(testLocObj)) if (Monitor.TryEnter(testLocObj))
{ {
try
{
retry: retry:
string logtxt = $"【" + cameraName + "】开始取图片测试是否有料盘" + "\r\n"; string logtxt = $"【" + cameraName + "】开始取图片测试是否有料盘" + "\r\n";
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
...@@ -348,7 +350,6 @@ namespace DeviceLibrary ...@@ -348,7 +350,6 @@ namespace DeviceLibrary
bmp.Dispose(); bmp.Dispose();
if (!string.IsNullOrEmpty(logtxt)) if (!string.IsNullOrEmpty(logtxt))
LogUtil.info(logtxt); LogUtil.info(logtxt);
Monitor.Exit(testLocObj);
} }
} }
else else
...@@ -498,10 +499,13 @@ namespace DeviceLibrary ...@@ -498,10 +499,13 @@ namespace DeviceLibrary
bmp.Dispose(); bmp.Dispose();
if (!string.IsNullOrEmpty(logtxt)) if (!string.IsNullOrEmpty(logtxt))
LogUtil.info(logtxt); LogUtil.info(logtxt);
Monitor.Exit(testLocObj);
} }
} }
}
finally
{
Monitor.Exit(testLocObj);
}
} }
else else
return null; return null;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!