TThread.resume在Delphi-2010中不推荐使用什么应该使用到位?

TThread.resume在Delphi-2010中不推荐使用什么应该使用到位?,第1张

概述在我的多线程应用程序中 我使用TThread.suspend和TThread.resume 自从将我的应用程序移至Delphi 2010之后,我得到了下面的交战消息 [DCC警告] xxx.pas(277):W1000不推荐使用符号’Resume’ 如果Resume被弃用,应该使用什么? 编辑1: 我使用Resume命令启动线程 – 因为它是创建与’CreateSuspended’设置为真和暂停在 在我的多线程应用程序中

我使用TThread.suspend和TThread.resume

自从将我的应用程序移至Delphi 2010之后,我得到了下面的交战消息

[DCC警告] xxx.pas(277):W1000不推荐使用符号’Resume’

如果Resume被弃用,应该使用什么?

编辑1:

我使用Resume命令启动线程 – 因为它是创建与’CreateSuspended’设置为真和暂停在我终止线程。

编辑2:

Here is a link the delphi 2010 manual

解决方法 Charles如果你读了TThread类的代码,你会找到答案。
TThread = class     private type  ......      public       constructor Create(CreateSuspended: Boolean);       destructor Destroy; overrIDe;       procedure AfterConstruction; overrIDe;       // This function is not intended to be used for thread synchronization.       procedure Resume; deprecated;       // Use Start after creating a suspended thread.       procedure Start;       // This function is not intended to be used for thread synchronization.       procedure Suspend; deprecated;       procedure Terminate;

请参阅此链接
http://wings-of-wind.com/2009/08/28/rad-studio-2010-community-pulse-the-day-after-part-2/

编辑:

如果需要同步线程,可以使用基于TMutex,TEvent和关键部分的方案。

再见。

总结

以上是内存溢出为你收集整理的TThread.resume在Delphi-2010中不推荐使用什么应该使用到位?全部内容,希望文章能够帮你解决TThread.resume在Delphi-2010中不推荐使用什么应该使用到位?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1282318.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存