Beispiel #1
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="param"></param>
 public LockWait(ref LockParam param)
 {
     this._param = param;
     while (Interlocked.CompareExchange(ref param.signal, 1, 0) == 1)
     {
         Thread.Sleep(param.sleepInterval);
     }
 }
Beispiel #2
0
 /// <summary>
 /// 释放
 /// </summary>
 public void Dispose()
 {
     OnDispose();
     Clear();
     pool           = null;
     lockParam      = null;
     onClearObject  = null;
     onGetObject    = null;
     onSetObject    = null;
     onCreateObject = null;
 }
Beispiel #3
0
 /// <summary>
 /// Ctor
 /// </summary>
 protected ObjectPool()
 {
     pool = new List <T>(); lockParam = new LockParam();
 }
Beispiel #4
0
 /// <summary>
 /// Ctor
 /// </summary>
 protected ObjectPool()
 {
     lockParam = new LockParam();
 }