, , - , . , "" - . , , , .
, lock, Enter Exit, Monitor.
, , start request end. lock, Excel, , Enter Exit.
FYI a lock Monitor .
lock(_syncObj)
{
}
Monitor.Enter(_syncObj);
try
{
}
finally
{
Monitor.Exit(_syncObj);
}
lock, Excel :
ExcelUtil.DoStuff("bling")
public static class ExcelUtil
{
private static readonly object SyncObj = new object();
public static void DoStuff(string someParam)
{
lock (SyncObj)
{
DoSomeStuffWithExcelFuncA();
DoSomeStuffWithExcelFuncB();
}
}
private static void DoSomeStuffWithExcelFuncA()
{
}
private static void DoSomeStuffWithExcelFuncB()
{
}
}
, Excel? , Excel ASP.Net. , , , . Excel , . , Excel. , Excel ?
, , ( Excel) - .