Vote UpVote

Value Never Used – Or Is It?

The Delphi Geek – Sometimes, dcc32 is just plain stupid … I have this code in the OmniThreadLibrary:function TOmniThreadPool.Cancel(taskID: int64): boolean;var res: TOmniWaitableValue;begin {$IF CompilerVersion >= 22} Result := false; // not really used {$IFEND} res := TOmniWaitableValue.Create; try otpWorkerTask.Invoke(@TOTPWorker.Cancel, [taskID, res]); res.WaitFor(INFINITE); Result := res.Value; finally FreeAndNil(res); end;end;The IFDEF part is there because otherwise compiler complains about result being potentially undefined.[DCC Warning] OtlThreadPool.pas(1315): W1035 Return value of ...
Favorite? Off-Topic? gabr @ 2015-04-25 13:57


Visits: 813
Votes: 2
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)