File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread - suspend()

 
Deepti Dixit
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why should the following code even complile ? Isn't suspend() supposed to be called by some other thread on the current thread ?
It prints "Test" and hangs there!
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Deepti Dixit:
Why should the following code even complile ? Isn't suspend() supposed to be called by some other thread on the current thread ?
It prints "Test" and hangs there!


Well first of all suspend and resume are deprecated & yes you are right that other threads should call suspend, in this context the thread itself is calling suspend and there is no other thread which you have created which will resume the thread which is suspended. There is no reason to get compiler error, the code is perfectly ok and passes the compiler check.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic