日期:2014-05-18 浏览次数:20438 次
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; } }