如何唤醒suspend的线程?(100分)

H

hgu

Unregistered / Unconfirmed
GUEST, unregistred user!
请问我在线程中suspend自己后,如何才能resume?suspend&resume方法只能由线程自己调用,线程可以自己suspend,但suspend后失去了控制权,如何才能恢复?
 
用Tthread.resume可以啊!
 
可以使用TThread.suspended方法来判断是否已经被suspend,如果返回true,
可以使用resume来执行被suspend的线程;实在不行,重载suspend和resume,完全由自
己控制.
 
在另外的线程(如主线程)中 TThread.resume
 
suspend &
resume只能由线程本身调用,不知诸位有无发现在主程序里是无法调用Thread.suspend &
thread.resume 编译就通不过:This Form of method call only allowed for class methods.重载也不行。不过我已经解决,方法是通过API
SuspendThread &
ResumeThread
 
多人接受答案了。
 
顶部