【发布时间】:2012-03-04 13:14:44
【问题描述】:
我遇到了以下情况
private volatile bool _inProgress = false;
public void DoSomethingStart()
{
if(_inProgress == false)
{
foo.BeginInvoke(null, null); // DoSomething
_inProgress = true;
}
}
[CatchAllExceptionsFromHere]
private void DoSomething()
{ }
到目前为止,这些方面都有效。所有异常都从 CatchAllExceptionsFromHere 处理。但我想在方面的 finally 子句中设置“_inProgress = false” - 所以如果 DoSomething 已经完成,“_inProgress”应该设置为 false。由于 Attributes 不能接受任何对象 - 是否有解决方法?
谢谢迈克尔
【问题讨论】:
标签: postsharp