對象池一般在服務端使用,所以穩定性是第一的。
歡迎提意見
= ////== /////// <summary> ////// </summary>/// <summary> ////// </summary> /// <summary> ////// </summary> /// <summary> ////// </summary> createObject: TObject; Create(pvObjectClass: TClass = Destroy; /// <summary> ////// </summary> /// <summary> ////// </summary> /// <summary> ////// </summary> /// <summary> ////// </summary> ///// <summary> ////// </summary> /// <summary> ////// </summary> Count: Integer /// <summary> ////// </summary> MaxNum: Integer FMaxNum /// <summary> ////// </summary> Name: String FName /// <summary> ///////// </summary> TimeOut: Integer FTimeOut FUsableList.Count > = PObjectBlock(FUsableList[FUsableList.Count-- TMyObjectPool.Create(pvObjectClass: TClass = ====//= //等待超時信號燈 = * //= CreateEvent(, True, True, //= CreateEvent(, True, True, = FObjectClass <> == i := FBusyList.Count - = lvObj.FObject = pvObject == True //////如果當前有1個可用,= FUsableList.Count > = PObjectBlock(FUsableList[FUsableList.Count--== = GetCount >= FMaxNum //如果當前有1個可用,//// exception.CreateFmt(= lvObject = exception.CreateFmt(=== //=// (GetCount < FMaxNum) // (FUsableList.Count > ) // // // FBusyList.Count > // //= FUsableList.Count +== lvRet = WAIT_OBJECT_ == lvRet <> WAIT_OBJECT_ Exception.CreateFmt(.