请问lock(obj)和Application.Lock有什么区别?
int a = 0; lock (Application["delDatetime"]) { a += 1; Application["delDatetime"] = System.DateTime.Now; }
int a = 0; Application.Lock(); a += 1; Application["delDatetime"] = System.DateTime.Now; Application.UnLock();
internal virtual void AcquireWrite(){ lock (this) { while (this._lock != 0) { try { Monitor.Wait(this); continue; } catch (ThreadInterruptedException) { continue; } } this._lock = -1; }}