Exemple #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);
     }
 }
Exemple #2
0
 /// <summary>
 /// 释放
 /// </summary>
 public void Dispose()
 {
     OnDispose();
     Clear();
     pool           = null;
     lockParam      = null;
     onClearObject  = null;
     onGetObject    = null;
     onSetObject    = null;
     onCreateObject = null;
 }
Exemple #3
0
 /// <summary>
 /// Ctor
 /// </summary>
 protected ObjectPool()
 {
     pool = new List <T>(); lockParam = new LockParam();
 }
Exemple #4
0
 /// <summary>
 /// Ctor
 /// </summary>
 protected ObjectPool()
 {
     lockParam = new LockParam();
 }